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>
Philippe Mathieu-Daudé committed
Jul 3, 2026 at 15:09 UTC
5ba4a7d02b4ac07f01815185873afd28330f04ba
3 files changed
+3
-8
gdbstub/internals.h
-1
@@ -217,7 +217,6 @@ void gdb_syscall_handling(const char *syscall_packet);
217
* Break/Watch point support - there is an implementation for system
218
* and user mode.
219
*/
220
-bool gdb_supports_guest_debug(void);
220
int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len);
221
int gdb_breakpoint_remove(CPUState *cs, int type, vaddr addr, vaddr len);
222
void gdb_breakpoint_remove_all(CPUState *cs);
gdbstub/system.c
+3
-1
@@ -331,6 +331,8 @@ static void create_processes(GDBState *s)
331
gdb_create_default_process(s);
332
}
333
334
+static bool gdb_supports_guest_debug(void);
335
+
336
bool gdbserver_start(const char *device, Error **errp)
337
{
338
Chardev *chr = NULL;
@@ -627,7 +629,7 @@ int gdb_signal_to_target(int sig)
629
* Break/Watch point helpers
630
*/
631
630
-bool gdb_supports_guest_debug(void)
632
+static bool gdb_supports_guest_debug(void)
633
{
634
const AccelOpsClass *ops = cpus_get_accel();
635
if (ops->supports_guest_debug) {
gdbstub/user.c
-6
@@ -796,12 +796,6 @@ bool gdb_can_reverse(void)
796
* Break/Watch point helpers
797
*/
798
799
-bool gdb_supports_guest_debug(void)
800
-{
801
- /* user-mode == TCG == supported */
802
- return true;
803
-}
804
-
799
int gdb_breakpoint_insert(CPUState *cs, int type, vaddr addr, vaddr len)
800
{
801
CPUState *cpu;