diff options
author | J.T. Conklin <jtc@acorntoolworks.com> | 1995-07-31 22:46:03 +0000 |
---|---|---|
committer | J.T. Conklin <jtc@acorntoolworks.com> | 1995-07-31 22:46:03 +0000 |
commit | 1a49497348d02ffd9ba0eab6881bb3353223a068 (patch) | |
tree | 128c13b69db4b27e1de00b36258d7d03281a4bbe /gdb/inflow.c | |
parent | f641906be5812ffce356207b1248f9846c657a34 (diff) | |
download | binutils-gdb-1a49497348d02ffd9ba0eab6881bb3353223a068.tar.gz |
* configure.in: Check for unistd.h.
* configure: Regenerated.
* command.c, cp-valprint.c, fork-child.c, i386-tdep.c,
i386b-nat.c, inflow.c, main.c, maint.c, objfiles.c, solib.c,
source.c, stack.c, symfile.c, top.c, utils.c: Include strings.h
and/or unistd.h to bring prototypes into scope.
Diffstat (limited to 'gdb/inflow.c')
-rw-r--r-- | gdb/inflow.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/gdb/inflow.c b/gdb/inflow.c index 353c6c4ee3f..56dc0e67924 100644 --- a/gdb/inflow.c +++ b/gdb/inflow.c @@ -1,5 +1,5 @@ /* Low level interface to ptrace, for GDB when running under Unix. - Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc. + Copyright 1986, 1987, 1989, 1991, 1992, 1995 Free Software Foundation, Inc. This file is part of GDB. @@ -27,10 +27,11 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "target.h" #include "thread.h" +#include <string.h> #include <signal.h> #include <fcntl.h> -#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY) && !defined (__GO32__) +#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY) && !defined (__GO32__) && !defined(WIN32) #define HAVE_SGTTY #endif @@ -483,7 +484,7 @@ new_tty () if (inferior_thisrun_terminal == 0) return; -#if !defined(__GO32__) +#if !defined(__GO32__) && !defined(WIN32) #ifdef TIOCNOTTY /* Disconnect the child process from our controlling terminal. On some systems (SVR4 for example), this may cause a SIGTTOU, so temporarily @@ -522,7 +523,7 @@ new_tty () { close (2); dup (tty); } if (tty > 2) close(tty); -#endif /* !go32 */ +#endif /* !go32 && !win32*/ } /* Kill the inferior process. Make us have no inferior. */ @@ -533,7 +534,11 @@ kill_command (arg, from_tty) char *arg; int from_tty; { - if (!target_has_execution) + /* FIXME: This should not really be inferior_pid (or target_has_execution). + It should be a distinct flag that indicates that a target is active, cuz + some targets don't have processes! */ + + if (inferior_pid == 0) error ("The program is not being run."); if (!query ("Kill the program being debugged? ")) error ("Not confirmed."); @@ -568,13 +573,19 @@ static void (*osig)(); void set_sigint_trap() { - osig = (void (*) ()) signal (SIGINT, pass_signal); + if (attach_flag || inferior_thisrun_terminal) + { + osig = (void (*) ()) signal (SIGINT, pass_signal); + } } void clear_sigint_trap() { - signal (SIGINT, osig); + if (attach_flag || inferior_thisrun_terminal) + { + signal (SIGINT, osig); + } } #if defined (SIGIO) && defined (FASYNC) && defined (FD_SET) && defined (F_SETOWN) |