diff options
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 353c6c4..56dc0e6 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) |