Commit 5ba4a7d02b for qemu.org

commit 5ba4a7d02b4ac07f01815185873afd28330f04ba
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Fri Jul 3 15:09:49 2026 +0200

    gdbstub: Reduce gdb_supports_guest_debug() scope

    gdb_supports_guest_debug() is only required for system emulation,
    reduce its scope by making it private; remove the user emulation
    variant.

    Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
    Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
    Message-ID: <20260705215729.62196-13-philmd@oss.qualcomm.com>

diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 9b25bf58b8..60ddc14666 100644
--- a/gdbstub/internals.h
+++ b/gdbstub/internals.h
@@ -217,7 +217,6 @@ void gdb_syscall_handling(const char *syscall_packet);
  * Break/Watch point support - there is an implementation for system
  * and user mode.
  */
-bool gdb_supports_guest_debug(void);
 int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len);
 int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len);
 void gdb_breakpoint_remove_all(CPUState *cs);
diff --git a/gdbstub/system.c b/gdbstub/system.c
index 2063b63b2f..1179c82cb8 100644
--- a/gdbstub/system.c
+++ b/gdbstub/system.c
@@ -331,6 +331,8 @@ static void create_processes(GDBState *s)
     gdb_create_default_process(s);
 }

+static bool gdb_supports_guest_debug(void);
+
 bool gdbserver_start(const char *device, Error **errp)
 {
     Chardev *chr = NULL;
@@ -627,7 +629,7 @@ int gdb_signal_to_target(int sig)
  * Break/Watch point helpers
  */

-bool gdb_supports_guest_debug(void)
+static bool gdb_supports_guest_debug(void)
 {
     const AccelOpsClass *ops = cpus_get_accel();
     if (ops->supports_guest_debug) {
diff --git a/gdbstub/user.c b/gdbstub/user.c
index 97eb13e796..f7bc4e63df 100644
--- a/gdbstub/user.c
+++ b/gdbstub/user.c
@@ -796,12 +796,6 @@ bool gdb_can_reverse(void)
  * Break/Watch point helpers
  */

-bool gdb_supports_guest_debug(void)
-{
-    /* user-mode == TCG == supported */
-    return true;
-}
-
 int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len)
 {
     CPUState *cpu;