From: Andrew Burgess <aburgess@redhat.com>
To: Tom Tromey <tromey@adacore.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 2/2] Disabling hardware single step in gdbserver
Date: Thu, 16 Nov 2023 10:14:48 +0000 [thread overview]
Message-ID: <87fs16qa1z.fsf@redhat.com> (raw)
In-Reply-To: <20230612-sw-single-step-v1-2-c06d648e121b@adacore.com>
Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> writes:
> This patch gives gdbserver the ability to omit the 's' reply to
> 'vCont?'. This tells gdb that hardware single-step is definitely not
> supported, causing it to fall back to using software single-step.
> This is useful for testing the earlier change to
> maybe_software_singlestep.
LGTM.
Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks,
Andrew
> ---
> gdbserver/server.cc | 12 ++++++++----
> gdbserver/server.h | 1 +
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/gdbserver/server.cc b/gdbserver/server.cc
> index c57270175b4..afc18a87770 100644
> --- a/gdbserver/server.cc
> +++ b/gdbserver/server.cc
> @@ -135,6 +135,7 @@ unsigned long signal_pid;
> in gdbserver, for the sake of testing GDB against stubs that don't
> support them. */
> bool disable_packet_vCont;
> +bool disable_packet_vCont_step;
> bool disable_packet_Tthread;
> bool disable_packet_qC;
> bool disable_packet_qfThreadInfo;
> @@ -3125,9 +3126,10 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
> {
> strcpy (own_buf, "vCont;c;C;t");
>
> - if (target_supports_hardware_single_step ()
> - || target_supports_software_single_step ()
> - || !cs.vCont_supported)
> + if (!disable_packet_vCont_step
> + && (target_supports_hardware_single_step ()
> + || target_supports_software_single_step ()
> + || !cs.vCont_supported))
> {
> /* If target supports single step either by hardware or by
> software, add actions s and S to the list of supported
> @@ -3456,7 +3458,7 @@ gdbserver_usage (FILE *stream)
> " --disable-packet=OPT1[,OPT2,...]\n"
> " Disable support for RSP packets or features.\n"
> " Options:\n"
> - " vCont, T, Tthread, qC, qfThreadInfo and \n"
> + " vCont, vConts, T, Tthread, qC, qfThreadInfo and\n"
> " threads (disable all threading packets).\n"
> "\n"
> "For more information, consult the GDB manual (available as on-line \n"
> @@ -3766,6 +3768,8 @@ captured_main (int argc, char *argv[])
> {
> if (strcmp ("vCont", tok) == 0)
> disable_packet_vCont = true;
> + else if (strcmp ("vConts", tok) == 0)
> + disable_packet_vCont_step = true;
> else if (strcmp ("Tthread", tok) == 0)
> disable_packet_Tthread = true;
> else if (strcmp ("qC", tok) == 0)
> diff --git a/gdbserver/server.h b/gdbserver/server.h
> index fde7dfe7060..70fd8ff8b55 100644
> --- a/gdbserver/server.h
> +++ b/gdbserver/server.h
> @@ -68,6 +68,7 @@ void initialize_low ();
> extern bool server_waiting;
>
> extern bool disable_packet_vCont;
> +extern bool disable_packet_vCont_step;
> extern bool disable_packet_Tthread;
> extern bool disable_packet_qC;
> extern bool disable_packet_qfThreadInfo;
>
> --
> 2.40.1
next prev parent reply other threads:[~2023-11-16 10:14 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-12 19:21 [PATCH 0/2] Call target_can_do_single_step from maybe_software_singlestep Tom Tromey
2023-06-12 19:21 ` [PATCH 1/2] " Tom Tromey
2023-11-16 10:12 ` Andrew Burgess
2023-06-12 19:21 ` [PATCH 2/2] Disabling hardware single step in gdbserver Tom Tromey
2023-11-16 10:14 ` Andrew Burgess [this message]
2023-09-07 17:59 ` [PATCH 0/2] Call target_can_do_single_step from maybe_software_singlestep Tom Tromey
2023-11-15 19:01 ` Tom Tromey
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=87fs16qa1z.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@adacore.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).