diff options
author | Jason Molenda <jmolenda@apple.com> | 1999-10-05 23:13:56 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 1999-10-05 23:13:56 +0000 |
commit | 2acceee2182a942e6a79a972009540990f4dfabf (patch) | |
tree | 2ed7ca473f0b49181f1d0214c3450a7eb17f7bcb /gdb/event-top.c | |
parent | 3e9c42873ee1d0bbb03039baea78c617174f9269 (diff) | |
download | gdb-2acceee2182a942e6a79a972009540990f4dfabf.zip gdb-2acceee2182a942e6a79a972009540990f4dfabf.tar.gz gdb-2acceee2182a942e6a79a972009540990f4dfabf.tar.bz2 |
import gdb-1999-10-04 snapshot
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r-- | gdb/event-top.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c index b1b625d..7e6cf83 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -34,6 +34,8 @@ #include <readline/readline.h> #include <readline/history.h> +#include <signal.h> + /* readline defines this. */ #undef savestring @@ -399,12 +401,12 @@ pop_prompt (void) instead of calling gdb_readline2, give gdb a chance to detect errors and do something. */ void -stdin_event_handler (int error, int fd, gdb_client_data client_data) +stdin_event_handler (int error, gdb_client_data client_data) { if (error) { - printf_unfiltered ("error detected on stdin, fd %d\n", fd); - delete_file_handler (fd); + printf_unfiltered ("error detected on stdin\n"); + delete_file_handler (input_fd); discard_all_continuations (); /* If stdin died, we may as well kill gdb. */ exit (1); @@ -443,7 +445,10 @@ async_disable_stdin (void) sync/async mode) is refined, the duplicate calls can be eliminated (Here or in infcmd.c/infrun.c). */ target_terminal_inferior (); - make_exec_cleanup (async_enable_stdin, NULL); + /* Add the reinstate of stdin to the list of cleanups to be done + in case the target errors out and dies. These cleanups are also + done in case of normal successful termination of the execution + command, by complete_execution(). */ make_exec_error_cleanup (async_enable_stdin, NULL); } @@ -1037,7 +1042,15 @@ async_stop_sig (gdb_client_data arg) char *prompt = get_prompt (); #if STOP_SIGNAL == SIGTSTP signal (SIGTSTP, SIG_DFL); +#if HAVE_SIGPROCMASK + { + sigset_t zero; + sigemptyset (&zero); + sigprocmask (SIG_SETMASK, &zero, 0); + } +#else sigsetmask (0); +#endif kill (getpid (), SIGTSTP); signal (SIGTSTP, handle_stop_sig); #else |