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

Christina Schimpe via Gdb-patches
2022-03-29T13:14:14Z

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(-)

diff --git a/gdb/remote.c b/gdb/remote.c
index 510af52c49..5536ce7be2 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -455,9 +455,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. */
@@ -4934,6 +4931,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 ();
@@ -6444,7 +6445,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
@@ -6634,9 +6634,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;

@@ -7168,12 +7165,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"));

@@ -14568,9 +14559,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
@@ -14853,9 +14841,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);
}
--
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