diff options
author | Daniel Jacobowitz <drow@false.org> | 2009-11-13 22:36:30 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2009-11-13 22:36:30 +0000 |
commit | 3a29589aa25e5621af389dd5f6245d83d3a8266c (patch) | |
tree | 4ef2580da3447f035e6b3fcd95b9165fac8d7e3e /gdb/remote-fileio.c | |
parent | 3d8d5e79c0d5cdad628b570e3de267f28bea62d1 (diff) | |
download | gdb-3a29589aa25e5621af389dd5f6245d83d3a8266c.zip gdb-3a29589aa25e5621af389dd5f6245d83d3a8266c.tar.gz gdb-3a29589aa25e5621af389dd5f6245d83d3a8266c.tar.bz2 |
2009-11-13 Kazu Hirata <kazu@codesourcery.com>
Maxim Kuvyrkov <maxim@codesourcery.com>
* remote-fileio.c (remote_fileio_request): Send Ctrl-C if it is
pending.
* remote-fileio.h: Update the prototype for remote_fileio_request.
* remote.c (struct remote_state): Add ctrlc_pending_p.
(remote_open_1): Clear ctrlc_pending_p.
(remote_stop_as): Set ctrlc_pending_p to 1.
(remote_wait_as): Pass ctrlc_pending_p to remote_fileio_request.
Diffstat (limited to 'gdb/remote-fileio.c')
-rw-r--r-- | gdb/remote-fileio.c | 46 |
1 files changed, 31 insertions, 15 deletions
diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 31ee244..22311ba 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -1416,28 +1416,44 @@ remote_fileio_reset (void) } } +/* Handle a file I/O request. BUF points to the packet containing the + request. CTRLC_PENDING_P should be nonzero if the target has not + acknowledged the Ctrl-C sent asynchronously earlier. */ + void -remote_fileio_request (char *buf) +remote_fileio_request (char *buf, int ctrlc_pending_p) { int ex; remote_fileio_sig_init (); - remote_fio_ctrl_c_flag = 0; - remote_fio_no_longjmp = 0; - - ex = catch_exceptions (uiout, do_remote_fileio_request, (void *)buf, - RETURN_MASK_ALL); - switch (ex) + if (ctrlc_pending_p) { - case RETURN_ERROR: - remote_fileio_reply (-1, FILEIO_ENOSYS); - break; - case RETURN_QUIT: - remote_fileio_reply (-1, FILEIO_EINTR); - break; - default: - break; + /* If the target hasn't responded to the Ctrl-C sent + asynchronously earlier, take this opportunity to send the + Ctrl-C synchronously. */ + remote_fio_ctrl_c_flag = 1; + remote_fio_no_longjmp = 0; + remote_fileio_reply (-1, FILEIO_EINTR); + } + else + { + remote_fio_ctrl_c_flag = 0; + remote_fio_no_longjmp = 0; + + ex = catch_exceptions (uiout, do_remote_fileio_request, (void *)buf, + RETURN_MASK_ALL); + switch (ex) + { + case RETURN_ERROR: + remote_fileio_reply (-1, FILEIO_ENOSYS); + break; + case RETURN_QUIT: + remote_fileio_reply (-1, FILEIO_EINTR); + break; + default: + break; + } } remote_fileio_sig_exit (); |