]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Disabling hardware single step in gdbserver
authorTom Tromey <tromey@adacore.com>
Wed, 7 Jun 2023 15:32:46 +0000 (09:32 -0600)
committerTom Tromey <tromey@adacore.com>
Mon, 4 Aug 2025 16:39:20 +0000 (10:39 -0600)
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.

Approved-By: Andrew Burgess <aburgess@redhat.com>
gdbserver/server.cc
gdbserver/server.h

index 4037b1cd3144edd48d3b4295458da9067813bd2d..673b784e42b3d047bf9149f512137b54a0804a36 100644 (file)
@@ -143,6 +143,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;
@@ -3538,9 +3539,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
@@ -3873,7 +3875,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"
@@ -4293,6 +4295,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)
index 5609584f716488fca599a8d30dfa0f11b50042c8..b9dacb823bcb217a0bcbb08ced513ffa2e41737a 100644 (file)
@@ -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;