This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 5/7] Handle notification for all-stop.
Hi,
In all-stop mode, notification packet will be parsed/handled in
'remote_wait_as', so we define that all notifications have a
prefix 'N'. We parse rsp packet, and enqueue notification if it
is found. These queued notifications will be processed before
resuming inferior (in remote_resume).
gdb:
2012-10-23 Yao Qi <yao@codesourcery.com>
* remote.c (remote_wait_as): Call 'getpkt_or_notif_sane' instead
of 'getpkt_sane'.
Call 'handle_notification'.
---
gdb/remote.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/gdb/remote.c b/gdb/remote.c
index a72b364..7e9b373 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5708,7 +5708,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
_never_ wait for ever -> test on target_is_async_p().
However, before we do that we need to ensure that the caller
knows how to take the target into/out of async mode. */
- ret = getpkt_sane (&rs->buf, &rs->buf_size, wait_forever_enabled_p);
+ ret = getpkt_or_notif_sane (&rs->buf, &rs->buf_size, wait_forever_enabled_p);
if (!target_is_async_p ())
signal (SIGINT, ofunc);
}
@@ -5754,6 +5754,11 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
rs->waiting_for_stop_reply = 1;
break;
+ case 'N':
+ handle_notification (rs->buf);
+ /* The target didn't really stop; keep waiting. */
+ rs->waiting_for_stop_reply = 1;
+ break;
case '\0':
if (last_sent_signal != GDB_SIGNAL_0)
{
--
1.7.7.6