aboutsummaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2009-11-13 22:36:30 +0000
committerDaniel Jacobowitz <drow@false.org>2009-11-13 22:36:30 +0000
commit3a29589aa25e5621af389dd5f6245d83d3a8266c (patch)
tree4ef2580da3447f035e6b3fcd95b9165fac8d7e3e /gdb/remote.c
parent3d8d5e79c0d5cdad628b570e3de267f28bea62d1 (diff)
downloadgdb-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.c')
-rw-r--r--gdb/remote.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 664a9c7..9fa92fb 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -297,6 +297,10 @@ struct remote_state
/* True if the stub reports support for conditional tracepoints. */
int cond_tracepoints;
+
+ /* Nonzero if the user has pressed Ctrl-C, but the target hasn't
+ responded to that. */
+ int ctrlc_pending_p;
};
/* Returns true if the multi-process extensions are in effect. */
@@ -3394,6 +3398,7 @@ remote_open_1 (char *name, int from_tty, struct target_ops *target, int extended
rs->extended = extended_p;
rs->non_stop_aware = 0;
rs->waiting_for_stop_reply = 0;
+ rs->ctrlc_pending_p = 0;
general_thread = not_sent_ptid;
continue_thread = not_sent_ptid;
@@ -4122,6 +4127,8 @@ remote_stop_as (ptid_t ptid)
{
struct remote_state *rs = get_remote_state ();
+ rs->ctrlc_pending_p = 1;
+
/* If the inferior is stopped already, but the core didn't know
about it yet, just ignore the request. The cached wait status
will be collected in remote_wait. */
@@ -4848,6 +4855,11 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
/* We got something. */
rs->waiting_for_stop_reply = 0;
+ /* Assume that the target has acknowledged Ctrl-C unless we receive
+ an 'F' or 'O' packet. */
+ if (buf[0] != 'F' && buf[0] != 'O')
+ rs->ctrlc_pending_p = 0;
+
switch (buf[0])
{
case 'E': /* Error of some sort. */
@@ -4858,7 +4870,8 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
status->value.sig = TARGET_SIGNAL_0;
break;
case 'F': /* File-I/O request. */
- remote_fileio_request (buf);
+ remote_fileio_request (buf, rs->ctrlc_pending_p);
+ rs->ctrlc_pending_p = 0;
break;
case 'T': case 'S': case 'X': case 'W':
{