On 7/3/26 09:37, Philippe Mathieu-Daudé wrote:
gdb_supports_guest_debug() is only required for system emulation,
inline it there and remove the user emulation variant.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
gdbstub/internals.h | 1 -
gdbstub/system.c | 4 +++-
gdbstub/user.c | 6 ------
3 files changed, 3 insertions(+), 8 deletions(-)
You're not inlining it, but making it private to system.c.
Otherwise,
Reviewed-by: Richard Henderson <[email protected]>
r~
diff --git a/gdbstub/internals.h b/gdbstub/internals.h
index 9b25bf58b8e..60ddc146661 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 2063b63b2f8..1179c82cb86 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 97eb13e796a..f7bc4e63dfd 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;