This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 10/11] Reply s and S vCont actions if target supports hardware single step
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 1 Jul 2015 14:58:30 +0100
- Subject: [PATCH 10/11] Reply s and S vCont actions if target supports hardware single step
- Authentication-results: sourceware.org; auth=none
- References: <1435759111-22856-1-git-send-email-yao dot qi at linaro dot org>
Nowadays, GDBserver reports vCont s and S actions are supported
unconditionally in vCont? reply, which isn't accurate.
This patch is to teach GDBserver to tell GDB that whether GDBserver can
do hardware single step by reporting s and S in the vCont? reply, if
GDBserver knows it supports hardware single step.
gdb/gdbserver:
2015-06-30 Yao Qi <yao.qi@linaro.org>
* server.c (handle_v_requests): Append ";s;S" to own_buf if
target_supports_hardware_single_step returns true.
---
gdb/gdbserver/server.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index 858fbe5..e5a8f06 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -2766,7 +2766,14 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
if (startswith (own_buf, "vCont?"))
{
- strcpy (own_buf, "vCont;c;C;s;S;t");
+ strcpy (own_buf, "vCont;c;C;t");
+ if (target_supports_hardware_single_step ())
+ {
+ /* Only return s;S if target supports hardware single
+ step. */
+ own_buf = own_buf + strlen (own_buf);
+ strcpy (own_buf, ";s;S");
+ }
if (target_supports_range_stepping ())
{
own_buf = own_buf + strlen (own_buf);
--
1.9.1