All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gdbstub: reset supported features on Supported request
@ 2026-10-30 22:21 Pierrick Bouvier
  2026-11-04 14:25 ` Pierrick Bouvier
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pierrick Bouvier @ 2026-10-30 22:21 UTC (permalink / raw)
  To: qemu-devel
  Cc: Alex Bennée, brian.cain, Philippe Mathieu-Daudé,
	marco.liebel, Justin Sapp, Pierrick Bouvier

From: Justin Sapp <jsapp@qti.qualcomm.com>

https://sourceware.org/gdb/current/onlinedocs/gdb.html/General-Query-Packets.html#qSupported
```
Whenever the stub receives a ‘qSupported’ request, the supplied set
of GDB features should override any previous request. This allows GDB to
put the stub in a known state, even if the stub had previously been
communicating with a different version of GDB.
```

We exposed this by connecting to gdbstub using a gdb client first, and
then WinDbg (EXDI) for windows kernel debugging. Since they both
differ in their multiprocess support, this was confusing EXDI.

While we are here, fix the same for fork_events in user mode.

Signed-off-by: Pierrick Bouvier <pierrick.bouvier@oss.qualcomm.com>
---
 gdbstub/gdbstub.c | 6 ++++++
 gdbstub/user.c    | 1 +
 2 files changed, 7 insertions(+)

diff --git a/gdbstub/gdbstub.c b/gdbstub/gdbstub.c
index 0a328b0dd48..dbb2000c817 100644
--- a/gdbstub/gdbstub.c
+++ b/gdbstub/gdbstub.c
@@ -1679,6 +1679,12 @@ void gdb_extend_qsupported_features(char *qflags)
 
 static void handle_query_supported(GArray *params, void *user_ctx)
 {
+    /*
+     * Reset multiprocess support as a new gdb client may have different support
+     * than a previous one.
+     */
+    gdbserver_state.multiprocess = false;
+
     g_string_printf(gdbserver_state.str_buf, "PacketSize=%x", MAX_PACKET_LENGTH);
     if (gdb_get_core_xml_file(first_cpu)) {
         g_string_append(gdbserver_state.str_buf, ";qXfer:features:read+");
diff --git a/gdbstub/user.c b/gdbstub/user.c
index d810f0f38c3..9b6d42d210a 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -701,6 +701,7 @@ fail:
 
 void gdb_handle_query_supported_user(const char *gdb_supported)
 {
+    gdbserver_user_state.fork_events = false;
     if (strstr(gdb_supported, "fork-events+")) {
         gdbserver_user_state.fork_events = true;
     }
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-05  7:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30 22:21 [PATCH] gdbstub: reset supported features on Supported request Pierrick Bouvier
2026-11-04 14:25 ` Pierrick Bouvier
2026-11-04 16:41 ` Alex Bennée
2026-11-04 19:09 ` Marco Liebel
2026-11-05  7:39   ` Pierrick Bouvier
2026-11-05  7:55 ` Pierrick Bouvier

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.