From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 0/8, V4] A general notification in GDB RSP
Date: Tue, 11 Dec 2012 06:40:00 -0000 [thread overview]
Message-ID: <1355208017-9204-1-git-send-email-yao@codesourcery.com> (raw)
Hi,
We have more and more requirements that remote target wants to notify
GDB via RSP at any time during connection when some states are changed
in remote target. However, GDB doesn't have such general notification
infrastructure. This is what this patch set tries to add.
Nowadays, notification mechanism exists in GDB for '%Stop' only,
and works pretty good. My rationale of this work is 'decouple
%Stop/vStopped from existing notification mechanism so that
notification mechanism can handle other types of notification.
First of all, let us look at how '%Stop' and 'vStopped' works,
gdb gdbserver
<- %Stop // [1] Send notification
[after process other packets]
-> vStopped // [2] Ack this notification
<- T05 thread:2 // [3] Reply
-> vStopped // [4] Continue to query
<- OK // [5] Done
We can generalize this protocol like this,
gdb gdbserver
<- %NOTIF // [1] Send notification
[after process other packets]
-> vACK // [2] Ack this notification
<- EVENT // [3] Event
-> vACK // [4] Continue to query
<- OK // [5] Done
For each type of notification, we only have to define three things,
1) NOTIF, the key word of notification, for example, "Stop"
2) ACK, the command GDB ack to this notification, "vStopped" for
example,
3) EVENT, the format of event to GDB. GDBserver should be able to
send packet to comply with EVENT, and GDB is able parse the packet,
and identify the packet is EVENT or not.
This is the V4 of this patch series, there are some changes compared
with V3,
- Move macros in common/queue.h from the bottom to to top.
Move the comments of functions to macros, as users should use
macros externally,
- Don't treat 'Stop' a special notification, and keep the global
queue of stop reply.
- Move 'ptid' field out of 'struct notif_reply' (it is 'struct notif_event'
now).
- Rename some struct
- Add some comments in the code.
This patch series depends on this patch,
[PATCH] Attach discard_pending_stop_replies to observer inferior_exit
http://sourceware.org/ml/gdb-patches/2012-12/msg00126.html
All these patches are tested on x86_64-linux {native, gdbserver} x
{sync, async}. No regression.
gdb/Makefile.in | 9 +-
gdb/NEWS | 4 +
gdb/common/queue.h | 303 ++++++++++++++++++++++++++++
gdb/doc/gdb.texinfo | 6 +
gdb/gdbserver/Makefile.in | 4 +-
gdb/gdbserver/linux-low.c | 10 +
gdb/gdbserver/notif.c | 180 +++++++++++++++++
gdb/gdbserver/notif.h | 68 +++++++
gdb/gdbserver/server.c | 164 +++++----------
gdb/gdbserver/server.h | 2 -
gdb/remote-notif.c | 324 ++++++++++++++++++++++++++++++
gdb/remote-notif.h | 85 ++++++++
gdb/remote.c | 491 ++++++++++++++++++++++++---------------------
gdb/remote.h | 3 +
14 files changed, 1310 insertions(+), 343 deletions(-)
create mode 100644 gdb/common/queue.h
create mode 100644 gdb/gdbserver/notif.c
create mode 100644 gdb/gdbserver/notif.h
create mode 100644 gdb/remote-notif.c
create mode 100644 gdb/remote-notif.h
--
1.7.7.6
next reply other threads:[~2012-12-11 6:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-11 6:40 Yao Qi [this message]
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 6/8] Handle notification for all-stop Yao Qi
2012-12-12 18:28 ` 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 ` [PATCH 8/8] RSP notification 'Test' Yao Qi
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 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 5/8] Different notification from packets Yao Qi
2012-12-12 18:14 ` Pedro Alves
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-1-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