summaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorJason Molenda <jsm@bugshack.cygnus.com>1999-10-05 23:13:56 +0000
committerJason Molenda <jsm@bugshack.cygnus.com>1999-10-05 23:13:56 +0000
commitce8537f129e0aa7823f1e9ff610baea9edd4f9ce (patch)
tree44c31e9e3ca76fb002295a2ddafc1f6aa9a91a9e /gdb/event-top.c
parente61b94e5346142170a372e22f687753fcae79595 (diff)
downloadgdb-ce8537f129e0aa7823f1e9ff610baea9edd4f9ce.tar.gz
import gdb-1999-10-04 snapshot
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index b1b625d8a42..7e6cf8351ae 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