From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 1/5] Process notifications when reply is got
Date: Fri, 24 Jan 2014 09:43:00 -0000 [thread overview]
Message-ID: <1390556465-28796-2-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1390556465-28796-1-git-send-email-yao@codesourcery.com>
GDB needs some points to consume notification events in all-stop mode.
The end of remote_get_noisy_reply is good place, because GDB has got
a reply from stub, and isn't expecting any others. At this moment,
GDB is safe to ack notification events one by one. Likewise, it is a
good time ack notification event after GDB receives a stop reply.
With this change, GDB is able to get Trace notification when command
tstart or tstop is executed.
gdb:
2014-01-24 Yao Qi <yao@codesourcery.com>
* remote.c (get_remote_state): Declare.
(remote_get_noisy_reply): Call remote_notif_process if
non_stop is false.
(remote_wait_as): Likewise.
---
gdb/remote.c | 20 +++++++++++++++++++-
1 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/gdb/remote.c b/gdb/remote.c
index 1c914ba..7110e0a 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -233,6 +233,8 @@ static int remote_supports_cond_breakpoints (void);
static int remote_can_run_breakpoint_commands (void);
+static struct remote_state *get_remote_state (void);
+
/* For "remote". */
static struct cmd_list_element *remote_cmdlist;
@@ -600,7 +602,17 @@ remote_get_noisy_reply (char **buf_p,
else if (buf[0] == 'O' && buf[1] != 'K')
remote_console_output (buf + 1); /* 'O' message from stub */
else
- return buf; /* Here's the actual reply. */
+ {
+ struct remote_state *rs = get_remote_state ();
+
+ /* GDB has got the reply from the remote stub. It is safe
+ to query notification events, because GDB isn't expecting
+ any reply at this moment. */
+ if (!non_stop)
+ remote_notif_process (rs->notif_state, ¬if_client_stop);
+
+ return buf; /* Here's the actual reply. */
+ }
}
while (1);
}
@@ -6111,6 +6123,12 @@ remote_wait_as (ptid_t ptid, struct target_waitstatus *status, int options)
rs->buf);
event_ptid = process_stop_reply (stop_reply, status);
+
+ /* GDB has got the reply from the remote stub. It is safe
+ to query notification events, because GDB isn't expecting
+ any reply at this moment. */
+ if (!non_stop)
+ remote_notif_process (rs->notif_state, ¬if_client_stop);
break;
}
case 'O': /* Console output. */
--
1.7.7.6
next prev parent reply other threads:[~2014-01-24 9:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 9:43 [PATCH 0/5 V8] MI notification on trace started/stopped Yao Qi
2014-01-24 9:43 ` Yao Qi [this message]
2014-01-24 9:43 ` [PATCH 2/5] Query supported notifications by qSupported Yao Qi
2014-01-24 9:43 ` [PATCH 5/5] New test case mi-trace-changed.exp Yao Qi
2014-01-24 9:43 ` [PATCH 4/5] MI notification on trace started/stopped Yao Qi
2014-01-24 9:43 ` [PATCH 3/5] async remote notification 'Trace' 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=1390556465-28796-2-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