diff options
author | Pedro Alves <palves@redhat.com> | 2010-02-24 17:01:58 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2010-02-24 17:01:58 +0000 |
commit | 0723dbf578cc2f8ab942f4bbd36e1377adcd0620 (patch) | |
tree | 312b86861e6378fff025e8b3e4030d693a4efbb0 /gdb/remote.c | |
parent | 09de9781bdd949cdd00adec6e0693a0d79d70463 (diff) | |
download | gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.zip gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.tar.gz gdb-0723dbf578cc2f8ab942f4bbd36e1377adcd0620.tar.bz2 |
* inferior.h (ptid_match): Declare.
* infrun.c (ptid_match): New.
* remote.c (queued_stop_reply): Rewrite and use ptid_match.
(handle_notification): Add debug output.
* linux-nat.c (ptid_match): Delete.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 0ed49b9..7f8ec58 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -4637,26 +4637,23 @@ do_stop_reply_xfree (void *arg) static struct stop_reply * queued_stop_reply (ptid_t ptid) { - struct stop_reply *it, *prev; - struct stop_reply head; - - head.next = stop_reply_queue; - prev = &head; - - it = head.next; - - if (!ptid_equal (ptid, minus_one_ptid)) - for (; it; prev = it, it = it->next) - if (ptid_equal (ptid, it->ptid)) - break; + struct stop_reply *it; + struct stop_reply **it_link; - if (it) + it = stop_reply_queue; + it_link = &stop_reply_queue; + while (it) { - prev->next = it->next; - it->next = NULL; - } + if (ptid_match (it->ptid, ptid)) + { + *it_link = it->next; + it->next = NULL; + break; + } - stop_reply_queue = head.next; + it_link = &it->next; + it = *it_link; + } if (stop_reply_queue) /* There's still at least an event left. */ @@ -6169,10 +6166,13 @@ handle_notification (char *buf, size_t length) if (strncmp (buf, "Stop:", 5) == 0) { if (pending_stop_reply) - /* We've already parsed the in-flight stop-reply, but the stub - for some reason thought we didn't, possibly due to timeout - on its side. Just ignore it. */ - ; + { + /* We've already parsed the in-flight stop-reply, but the + stub for some reason thought we didn't, possibly due to + timeout on its side. Just ignore it. */ + if (remote_debug) + fprintf_unfiltered (gdb_stdlog, "ignoring resent notification\n"); + } else { struct cleanup *old_chain; @@ -6190,6 +6190,9 @@ handle_notification (char *buf, size_t length) /* Notify the event loop there's a stop reply to acknowledge and that there may be more events to fetch. */ mark_async_event_handler (remote_async_get_pending_events_token); + + if (remote_debug) + fprintf_unfiltered (gdb_stdlog, "stop notification captured\n"); } } else |