Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 6/8] Handle notification for all-stop.
Date: Tue, 11 Dec 2012 06:41:00 -0000	[thread overview]
Message-ID: <1355208017-9204-7-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1355208017-9204-1-git-send-email-yao@codesourcery.com>

Now, it is possible to get notifications in all-stop mode, so we
should use 'getpkt_or_notif_sane' instead of 'getpkt_sane'.  Beside
this, once a notification arrives, GDB will return to core as this
event is not interesting and keep waiting back again.

gdb:

2012-12-11  Yao Qi  <yao@codesourcery.com>

	* remote.c (remote_wait_as): Call 'getpkt_or_notif_sane' instead
	of 'getpkt_sane'.
	Return minus_one_ptid early if gets a notification.
---
 gdb/remote.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index f3ab5ce..5c8b20e 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5768,6 +5768,7 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
   else
     {
       int ret;
+      int is_notif;
 
       if (!target_is_async_p ())
 	{
@@ -5785,7 +5786,15 @@ 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, &is_notif);
+
+      if (ret != -1 && is_notif)
+	{
+	  /* The target didn't really stop; keep waiting.  */
+	  rs->waiting_for_stop_reply = 1;
+	  return minus_one_ptid;
+	}
       if (!target_is_async_p ())
 	signal (SIGINT, ofunc);
     }
-- 
1.7.7.6


  parent reply	other threads:[~2012-12-11  6:41 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-11  6:40 [PATCH 0/8, V4] A general notification in GDB RSP Yao Qi
2012-12-11  6:40 ` [PATCH 2/8] de-couple %Stop from notification: gdbserver Yao Qi
2012-12-12 17:06   ` Pedro Alves
2012-12-11  6:41 ` [PATCH 3/8] de-couple %Stop from notification: gdb Yao Qi
2012-12-12 17:32   ` Pedro Alves
2012-12-11  6:41 ` Yao Qi [this message]
2012-12-12 18:28   ` [PATCH 6/8] Handle notification for all-stop Pedro Alves
2012-12-11  6:41 ` [PATCH 5/8] Different notification from packets Yao Qi
2012-12-12 18:14   ` Pedro Alves
2012-12-11  6:41 ` [PATCH 4/8] command 'set debug notification' Yao Qi
2012-12-11  7:06   ` Eli Zaretskii
2012-12-12 17:57     ` Pedro Alves
2012-12-12 18:59       ` Eli Zaretskii
2012-12-12 19:17         ` Pedro Alves
2012-12-11  6:41 ` [PATCH 7/8] Cleanup pending queues before resume in all-stop Yao Qi
2012-12-12 18:22   ` Pedro Alves
2012-12-11  6:41 ` [PATCH 1/8] new queue.h in common/ Yao Qi
2012-12-12 17:05   ` Pedro Alves
2012-12-11  6:41 ` [PATCH 8/8] RSP notification 'Test' Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1355208017-9204-7-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox