[3/3] gdb: Remove workaround for the vCont packet

Message ID 20220113152118.1465255-4-christina.schimpe@intel.com
State New
Headers show
Series
  • Apply fixme notes for multi-target support
Related show

Commit Message

Simon Marchi via Gdb-patches Jan. 13, 2022, 3:21 p.m.
The workaround for the vCont packet is no longer required due to the
former commit "gdb: Make global feature array a per-remote target array".
The vCont packet is now checked once when the connection is started and
the supported vCont actions are set to the target's remote state
attribute.
---
 gdb/remote.c | 23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

-- 
2.25.1

Intel Deutschland GmbH
Registered Address: Am Campeon 10, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de <http://www.intel.de>
Managing Directors: Christin Eisenschmid, Sharon Heck, Tiffany Doon Silva  
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Comments

Tom Tromey Jan. 14, 2022, 7:42 p.m. | #1
>>>>> ">" == Christina Schimpe via Gdb-patches <gdb-patches@sourceware.org> writes:


>> The workaround for the vCont packet is no longer required due to the

>> former commit "gdb: Make global feature array a per-remote target array".

>> The vCont packet is now checked once when the connection is started and

>> the supported vCont actions are set to the target's remote state

>> attribute.


Thank you for the patch.

>> +  /* Check vCont support and set the remote state's vCont_action_support

>> +     attribute.  */

>> +  remote_vcont_probe ();

 
>> -  if (m_features.packet_support (PACKET_vCont) == PACKET_SUPPORT_UNKNOWN)

>> -    remote_vcont_probe ();


It seems like the new code should probably check whether the packet is
supported like the old code did, in case the gdb user disabled it using
the appropriate "set remote" command.

Tom

Patch

diff --git a/gdb/remote.c b/gdb/remote.c
index a270cb688c..4024801559 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -422,9 +422,6 @@  class remote_state
 
   /* The status of the stub support for the various vCont actions.  */
   vCont_action_support supports_vCont;
-  /* Whether vCont support was probed already.  This is a workaround
-     until packet_support is per-connection.  */
-  bool supports_vCont_probed;
 
   /* True if the user has pressed Ctrl-C, but the target hasn't
      responded to that.  */
@@ -4859,6 +4856,10 @@  remote_target::start_remote_1 (int from_tty, int extended_p)
      which later probes to skip.  */
   remote_query_supported ();
 
+  /* Check vCont support and set the remote state's vCont_action_support
+     attribute.  */
+  remote_vcont_probe ();
+
   /* If the stub wants to get a QAllow, compose one and send it.  */
   if (m_features.packet_support (PACKET_QAllow) != PACKET_DISABLE)
     set_permissions ();
@@ -6378,7 +6379,6 @@  remote_target::remote_vcont_probe ()
     }
 
   packet_ok (rs->buf, &m_features.m_protocol_packets[PACKET_vCont]);
-  rs->supports_vCont_probed = true;
 }
 
 /* Helper function for building "vCont" resumptions.  Write a
@@ -6568,9 +6568,6 @@  remote_target::remote_resume_with_vcont (ptid_t ptid, int step,
   if (::execution_direction == EXEC_REVERSE)
     return 0;
 
-  if (m_features.packet_support (PACKET_vCont) == PACKET_SUPPORT_UNKNOWN)
-    remote_vcont_probe ();
-
   if (m_features.packet_support (PACKET_vCont) == PACKET_DISABLE)
     return 0;
 
@@ -7112,12 +7109,6 @@  remote_target::remote_stop_ns (ptid_t ptid)
 	  }
       }
 
-  /* FIXME: This supports_vCont_probed check is a workaround until
-     packet_support is per-connection.  */
-  if (m_features.packet_support (PACKET_vCont) == PACKET_SUPPORT_UNKNOWN
-      || !rs->supports_vCont_probed)
-    remote_vcont_probe ();
-
   if (!rs->supports_vCont.t)
     error (_("Remote server does not support stopping threads"));
 
@@ -14516,9 +14507,6 @@  remote_target::can_do_single_step ()
     {
       struct remote_state *rs = get_remote_state ();
 
-      if (m_features.packet_support (PACKET_vCont) == PACKET_SUPPORT_UNKNOWN)
-	remote_vcont_probe ();
-
       return rs->supports_vCont.s && rs->supports_vCont.S;
     }
   else
@@ -14801,9 +14789,6 @@  show_range_stepping (struct ui_file *file, int from_tty,
 bool
 remote_target::vcont_r_supported ()
 {
-  if (m_features.packet_support (PACKET_vCont) == PACKET_SUPPORT_UNKNOWN)
-    remote_vcont_probe ();
-
   return (m_features.packet_support (PACKET_vCont) == PACKET_ENABLE
 	  && get_remote_state ()->supports_vCont.r);
 }