diff options
author | Fred Fish <fnf@specifix.com> | 1992-06-24 04:49:48 +0000 |
---|---|---|
committer | Fred Fish <fnf@specifix.com> | 1992-06-24 04:49:48 +0000 |
commit | e676a15f0b9ef089973311249917e203917b3903 (patch) | |
tree | ac8656c9b5795932c78ea01ea53ce9eabee5a9ae /gdb/inflow.c | |
parent | 0fd24984ce2d13dd7ec231afa5b42e60ff1f1858 (diff) | |
download | gdb-e676a15f0b9ef089973311249917e203917b3903.zip gdb-e676a15f0b9ef089973311249917e203917b3903.tar.gz gdb-e676a15f0b9ef089973311249917e203917b3903.tar.bz2 |
* Makefile.in (VERSION): Bump to 4.5.6.
* coffread.c (coff_end_symtab): Cast 2nd arg of complain() to
correct type.
* defs.h (NORETURN): Define away for Lucid compiler.
* remote.c (remote_timer, remote_interrupt): Signal handlers
take one int arg.
* ser-termios.c (serial_write, serial_close): Return whatever
value the write/close call returns, rather than falling off end.
* inferior.h (PTRACE_ARG3_TYPE): Third arg to ptrace is int on
more systems than it is "char *". Define PTRACE_ARG3_TYPE to
default to int.
* infptrace.c, hppabsd-xdep.c, hppahpux-xdep.c, i386-xdep.c,
inferior.h (call_ptrace): Use PTRACE_ARG3_TYPE to declare type
of third arg.
* a68v-xdep.c, arm-xdep.c, convex-xdep.c, hp300ux-xdep.c, infrun.c,
m88k-xdep.c, mach386-xdep.c, mips-xdep.c, os68k-xdep.c, pyr-tdep.c,
pyr-xdep.c, rs6000-xdep.c, sparc-xdep.c, sun3-xdep.c, sun386-xdep.c,
symm-xdep.c, ultra3-xdep.c: Use PTRACE_ARG3_TYPE to cast ptrace
argument 3.
* sparc-xdep.c, a68v-xdep.c (fetch_inferior_registers,
store_inferior_registers): Supply missing fourth argument to
ptrace().
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r-- | gdb/inflow.c | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c index 22b4968..8d9a6aa 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -17,7 +17,6 @@ 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 <stdio.h> #include "defs.h" #include "frame.h" #include "inferior.h" @@ -37,7 +36,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include <sys/param.h> #include <signal.h> -extern char *strerror(); /* strings corresponding to errno */ +static void +kill_command PARAMS ((char *, int)); + +static void +terminal_ours_1 PARAMS ((int)); extern struct target_ops child_ops; @@ -51,10 +54,10 @@ int attach_flag; /* Does GDB have a terminal (on stdin)? */ int gdb_has_a_terminal; - +#if !defined(__GO32__) static TERMINAL sg_inferior; static TERMINAL sg_ours; - +#endif static int tflags_inferior; static int tflags_ours; @@ -111,6 +114,7 @@ static void terminal_ours_1 (); void terminal_init_inferior () { +#if !defined(__GO32__) sg_inferior = sg_ours; tflags_inferior = tflags_ours; @@ -129,7 +133,7 @@ terminal_init_inferior () #ifdef TIOCGPGRP pgrp_inferior = inferior_pid; #endif /* TIOCGPGRP */ - +#endif terminal_is_ours = 1; } @@ -139,6 +143,7 @@ terminal_init_inferior () void terminal_inferior () { +#if !defined(__GO32__) int result; if (gdb_has_a_terminal && terminal_is_ours && inferior_thisrun_terminal == 0) @@ -175,6 +180,7 @@ terminal_inferior () sigquit_ours = (void (*) ()) signal (SIGQUIT, SIG_IGN); #endif /* TIOCGPGRP */ } +#endif terminal_is_ours = 0; } @@ -206,6 +212,7 @@ static void terminal_ours_1 (output_only) int output_only; { +#if !defined(__GO32__) int result; #ifdef TIOCGPGRP /* Ignore this signal since it will happen when we try to set the pgrp. */ @@ -278,6 +285,9 @@ terminal_ours_1 (output_only) #else /* not HAVE_TERMIO */ sg_ours.sg_flags &= ~RAW & ~CBREAK; #endif /* not HAVE_TERMIO */ + + result = result; /* lint */ +#endif } /* ARGSUSED */ @@ -301,7 +311,7 @@ child_terminal_info (args, from_tty) printf_filtered ("This GDB does not control a terminal.\n"); return; } - +#if !defined(__GO32__) #ifdef TIOCGPGRP printf_filtered ("Inferior's terminal status (currently saved by GDB):\n"); @@ -343,6 +353,10 @@ child_terminal_info (args, from_tty) #ifdef TIOCLGET printf_filtered ("lmode: 0x%x\n", lmode_inferior); #endif +#else + printf_filtered("This is a DOS machine; there is no terminal state\n"); +#endif + } /* NEW_TTY_PREFORK is called before forking a new child process, @@ -367,17 +381,22 @@ void new_tty () { register int tty; + void (*osigttou) (); if (inferior_thisrun_terminal == 0) return; - +#if !defined(__GO32__) #ifdef TIOCNOTTY - /* Disconnect the child process from our controlling terminal. */ + /* Disconnect the child process from our controlling terminal. On some + systems (SVR4 for example), this may cause a SIGTTOU, so temporarily + ignore SIGTTOU. */ tty = open("/dev/tty", O_RDWR); if (tty > 0) { + osigttou = (void (*)()) signal(SIGTTOU, SIG_IGN); ioctl(tty, TIOCNOTTY, 0); close(tty); + (void) signal(SIGTTOU, osigttou); } #endif @@ -403,6 +422,7 @@ new_tty () { close (2); dup (tty); } if (tty > 2) close(tty); +#endif /* !go32*/o } /* Kill the inferior process. Make us have no inferior. */ @@ -492,8 +512,8 @@ try_writing_regs_command (arg, from_tty) { QUIT; errno = 0; - value = call_ptrace (3, inferior_pid, i, 0); - call_ptrace (6, inferior_pid, i, value); + value = call_ptrace (3, inferior_pid, (PTRACE_ARG3_TYPE) i, 0); + call_ptrace (6, inferior_pid, (PTRACE_ARG3_TYPE) i, value); if (errno == 0) { printf (" Succeeded with address 0x%x; value 0x%x (%d).\n", @@ -527,8 +547,8 @@ Report which ones can be written."); /* Get all the current tty settings (including whether we have a tty at all!). */ +#if !defined(__GO32__) tflags_ours = fcntl (0, F_GETFL, 0); - OOPSY ("fcntl F_GETFL"); /* Should always work */ result = ioctl (0, TIOCGETP, &sg_ours); if (result == 0) { @@ -549,6 +569,10 @@ Report which ones can be written."); } else { gdb_has_a_terminal = 0; } +#else + gdb_has_a_terminal = 0; +#endif + terminal_is_ours = 1; } |