diff options
author | Daniel Jacobowitz <drow@false.org> | 2008-01-23 20:43:30 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2008-01-23 20:43:30 +0000 |
commit | 9fa2223dcd83ee1d32505f5b2b7b63602de0cdab (patch) | |
tree | 385c116b47db895c64c3feb7e77dd247ea34c5ec /gdb/remote.c | |
parent | e4967d85cbcaece8748a73d3b34c63f8d989e655 (diff) | |
download | gdb-9fa2223dcd83ee1d32505f5b2b7b63602de0cdab.zip gdb-9fa2223dcd83ee1d32505f5b2b7b63602de0cdab.tar.gz gdb-9fa2223dcd83ee1d32505f5b2b7b63602de0cdab.tar.bz2 |
* remote.c (remote_wait): Handle SIGINT between packets.
(remote_async_wait): Likewise.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index eefea2e..1239771 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -3204,6 +3204,13 @@ remote_wait (ptid_t ptid, struct target_waitstatus *status) char *buf, *p; ofunc = signal (SIGINT, remote_interrupt); + /* If the user hit C-c before this packet, or between packets, + pretend that it was hit right here. */ + if (quit_flag) + { + quit_flag = 0; + remote_interrupt (SIGINT); + } getpkt (&rs->buf, &rs->buf_size, 1); signal (SIGINT, ofunc); @@ -3413,7 +3420,16 @@ remote_async_wait (ptid_t ptid, struct target_waitstatus *status) char *buf, *p; if (!target_is_async_p ()) - ofunc = signal (SIGINT, remote_interrupt); + { + ofunc = signal (SIGINT, remote_interrupt); + /* If the user hit C-c before this packet, or between packets, + pretend that it was hit right here. */ + if (quit_flag) + { + quit_flag = 0; + remote_interrupt (SIGINT); + } + } /* FIXME: cagney/1999-09-27: If we're in async mode we should _never_ wait for ever -> test on target_is_async_p(). However, before we do that we need to ensure that the caller |