1994-03-23 22:25:00 +00:00
|
|
|
/* Macro definitions for running GDB on Apple Macintoshes.
|
|
|
|
Copyright (C) 1994 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
This file is part of GDB.
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
|
|
|
|
|
|
#include "m68k/xm-m68k.h"
|
|
|
|
|
|
|
|
#include "fopen-bin.h"
|
|
|
|
|
|
|
|
#define CANT_FORK
|
|
|
|
|
|
|
|
/* MPW C is basically ANSI, but doesn't actually enable __STDC__,
|
|
|
|
nor does it allow __STDC__ to be #defined. */
|
|
|
|
|
|
|
|
#ifndef ALMOST_STDC
|
|
|
|
#define ALMOST_STDC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BFD_TRUE_FALSE
|
|
|
|
#ifndef false
|
|
|
|
#define false mpw_false
|
|
|
|
#endif
|
|
|
|
#ifndef true
|
|
|
|
#define true mpw_true
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef MPW_C
|
|
|
|
|
|
|
|
#undef __PTR_TO_INT
|
|
|
|
#define __PTR_TO_INT(P) ((int)(P))
|
|
|
|
#undef __INT_TO_PTR
|
|
|
|
#define __INT_TO_PTR(P) ((char *)(P))
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
FILE *mpw_fopen ();
|
|
|
|
int mpw_fseek ();
|
|
|
|
void mpw_abort ();
|
|
|
|
|
|
|
|
/* Map these standard functions to improved versions in libiberty. */
|
|
|
|
|
|
|
|
#define fopen mpw_fopen
|
|
|
|
#define open mpw_open
|
|
|
|
#define fseek mpw_fseek
|
|
|
|
#define abort mpw_abort
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 19:57:02 +00:00
|
|
|
/* Map these standard functions to versions that can do I/O in a console
|
|
|
|
window. */
|
|
|
|
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 00:31:31 +00:00
|
|
|
#define printf hacked_printf
|
|
|
|
#define fprintf hacked_fprintf
|
|
|
|
#define vprintf hacked_vfprintf
|
|
|
|
#define fputs hacked_fputs
|
|
|
|
#define fputc hacked_fputc
|
|
|
|
#undef putc
|
|
|
|
#define putc hacked_putc
|
|
|
|
#define fflush hacked_fflush
|
|
|
|
|
* mpw-make.in (VERSION): Update to 4.12.3.
(SiowGDB): New target, GDB using SIOW library.
(init-new.c): New target, attempt to generate init.c from sources.
(main.c.o, top.c.o): Put each in its own segment.
* main.c (main) [MPW]: Always call mac_init.
* utils.c (query) [MPW]: Always return "yes" if in MacGDB, output
an extra newline otherwise.
* mac-xdep.c: More comments in various places, remove junk.
(mac_init): Add tests for MPW and SIOW.
(use_wne, has_color_qd): Renamed.
(use_color_qd): New variable.
(grow_window): Only do console resizing to console window,
call resize_console_window.
(zoom_window): Call resize_console_window.
(resize_console_window, scroll_text): New functions.
(adjust_console_sizes): Always align viewrect to even multiples of
text lines.
(adjust_console_text): Always scroll by whole lines.
(hacked_vfprintf, hacked_puts, hacked_fputc, hacked_putc): Force a
recalculation of scroll positions if a newline was output.
(hacked_fflush): Similarly, for flushing.
(hacked_fgetc): New function, aborts if called in MacGDB.
* ser-mac.c (mac_readchar): Rename starttime to start_time,
remove debugging printf.
(mac_write): Sleep on first 4 writes.
(sec_sleep): New function, works like standard sleep.
* macgdb.r: Adjust positioning and contents of About box.
Set minimum size to 2000K, preferred size to 5000K.
* config/m68k/xm-mpw.h (fgetc): Define as a macro.
1994-06-22 19:57:02 +00:00
|
|
|
#define fgetc hacked_fgetc
|
|
|
|
|
1994-03-23 22:25:00 +00:00
|
|
|
/* Define as macros so as to mask the previous enum. */
|
|
|
|
|
|
|
|
#ifndef BFD_TRUE_FALSE
|
|
|
|
#ifndef false
|
|
|
|
#define false ffalse
|
|
|
|
#endif
|
|
|
|
#ifndef true
|
|
|
|
#define true ttrue
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
#define TRUE_FALSE_ALREADY_DEFINED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define POSIX_UTIME
|
|
|
|
|
|
|
|
/* No declaration of strdup in MPW's string.h, oddly enough. */
|
|
|
|
|
|
|
|
char *strdup (char *s1);
|
|
|
|
|
|
|
|
/* '.' indicates drivers on the Mac, so we need a different filename. */
|
|
|
|
|
|
|
|
#define GDBINIT_FILENAME "_gdbinit"
|
|
|
|
|
1994-04-27 00:55:59 +00:00
|
|
|
/* Commas are more common to separate dirnames in a path on Macs. */
|
1994-03-23 22:25:00 +00:00
|
|
|
|
1994-04-27 00:55:59 +00:00
|
|
|
#define DIRNAME_SEPARATOR ','
|
1994-03-23 22:25:00 +00:00
|
|
|
|
|
|
|
/* This is a real crufty hack. */
|
|
|
|
|
|
|
|
#define HAVE_TERMIO
|
1994-04-27 00:55:59 +00:00
|
|
|
|
|
|
|
/* Addons to the basic MPW-supported signal list. */
|
|
|
|
|
|
|
|
#ifndef SIGQUIT
|
|
|
|
#define SIGQUIT (1<<6)
|
|
|
|
#endif
|
|
|
|
#ifndef SIGHUP
|
|
|
|
#define SIGHUP (1<<7)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* If __STDC__ is on, then this definition will be missing. */
|
|
|
|
|
|
|
|
#ifndef fileno
|
|
|
|
#define fileno(p) (p)->_file
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef R_OK
|
|
|
|
#define R_OK 4
|
|
|
|
#endif
|
Changes for MacGDB:
Thu May 12 17:04:58 1994 Stan Shebs (shebs@andros.cygnus.com)
* mpw-make.in (INCLUDE_CFLAGS): Add readline source dir.
(READLINE_CFLAGS, READLINE_SRC, READLINE_DIR): Uncomment.
(TSOBS): Don't compile inflow.c.
(all, install): Add MacGDB.
* main.c (main): Do Mac-specific init and command loop if a
standalone app, skip full option help message if compiling
with MPW C.
(gdb_readline): If MPW, add a newline after the (gdb) prompt.
* utils.c (_initialize_utils): If MPW, don't try to use termcap to
compute the window size.
* config/m68k/xm-mpw.h (printf, fprintf, fputs, fputc, putc,
fflush): Define as macros that expand into hacked_... versions.
(StandAlone, mac_app): Declare.
* macgdb.r (SIZE): Set the default partition to 4000K.
* mac-xdep.c (readline.h, history.h): Include.
(terminal.h): Don't include.
(mac_app): Define.
(gdb_has_a_terminal): Define Mac-specific version.
(do_keyboard_command): Simplify search for command string.
(readline): Define as gdb_readline.
Add other history/readline stubs to make main gdb link.
(hacked_fprintf, hacked_printf, hacked_vfprintf, hacked_fputs,
hacked_fputc, hacked_fflush): New functions, intercept output to
stdout and stderr, send to console window.
1994-05-13 00:31:31 +00:00
|
|
|
|
|
|
|
extern int StandAlone;
|
|
|
|
|
|
|
|
extern int mac_app;
|