gdbstub: move enums into separate header
authorAlex Bennée <alex.bennee@linaro.org>
Thu, 20 Jun 2024 15:22:10 +0000 (16:22 +0100)
committerAlex Bennée <alex.bennee@linaro.org>
Mon, 24 Jun 2024 09:14:17 +0000 (10:14 +0100)
This is an experiment to further reduce the amount we throw into the
exec headers. It might not be as useful as I initially thought because
just under half of the users also need gdbserver_start().

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20240620152220.2192768-3-alex.bennee@linaro.org>

14 files changed:
accel/hvf/hvf-accel-ops.c
accel/kvm/kvm-all.c
accel/tcg/tcg-accel-ops.c
gdbstub/user.c
include/exec/gdbstub.h
include/gdbstub/enums.h [new file with mode: 0644]
monitor/hmp-cmds.c
system/vl.c
target/arm/hvf/hvf.c
target/arm/hyp_gdbstub.c
target/arm/kvm.c
target/i386/kvm/kvm.c
target/ppc/kvm.c
target/s390x/kvm/kvm.c

index b2a37a2229fc208c06a62a97a7ea2c2959a86076..ac08cfb9f323c895e227d096d83fa65fd4896039 100644 (file)
@@ -52,7 +52,7 @@
 #include "qemu/main-loop.h"
 #include "exec/address-spaces.h"
 #include "exec/exec-all.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "sysemu/cpus.h"
 #include "sysemu/hvf.h"
 #include "sysemu/hvf_int.h"
index 854cb86b2234510011d301d2ad0707dbdb44bbf3..2b4ab896794bf15bace2b1c8db498d566c8ffd52 100644 (file)
@@ -27,7 +27,7 @@
 #include "hw/pci/msi.h"
 #include "hw/pci/msix.h"
 #include "hw/s390x/adapter.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "sysemu/kvm_int.h"
 #include "sysemu/runstate.h"
 #include "sysemu/cpus.h"
index 1433e38f40df87f65f565596dcc3830025121f9e..3c19e68a79e8f9f5cf5e49edc185bc7fc6c0ed26 100644 (file)
@@ -35,7 +35,7 @@
 #include "exec/exec-all.h"
 #include "exec/hwaddr.h"
 #include "exec/tb-flush.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 
 #include "hw/core/cpu.h"
 
index edeb72efebcb7f1dba13e61950bda78a14702210..e34b58b40732b66fec701637318701b29ae94f1f 100644 (file)
@@ -18,6 +18,7 @@
 #include "exec/gdbstub.h"
 #include "gdbstub/syscalls.h"
 #include "gdbstub/user.h"
+#include "gdbstub/enums.h"
 #include "hw/core/cpu.h"
 #include "trace.h"
 #include "internals.h"
index 008a92198a6a167f338774693175304a2757f632..1bd2c4ec2a30c3be8fafebeeb12ab97a3c24d595 100644 (file)
@@ -1,15 +1,6 @@
 #ifndef GDBSTUB_H
 #define GDBSTUB_H
 
-#define DEFAULT_GDBSTUB_PORT "1234"
-
-/* GDB breakpoint/watchpoint types */
-#define GDB_BREAKPOINT_SW        0
-#define GDB_BREAKPOINT_HW        1
-#define GDB_WATCHPOINT_WRITE     2
-#define GDB_WATCHPOINT_READ      3
-#define GDB_WATCHPOINT_ACCESS    4
-
 typedef struct GDBFeature {
     const char *xmlname;
     const char *xml;
diff --git a/include/gdbstub/enums.h b/include/gdbstub/enums.h
new file mode 100644 (file)
index 0000000..c4d54a1
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * gdbstub enums
+ *
+ * Copyright (c) 2024 Linaro Ltd
+ *
+ * SPDX-License-Identifier: GPL-2.0-or-later
+ */
+
+#ifndef GDBSTUB_ENUMS_H
+#define GDBSTUB_ENUMS_H
+
+#define DEFAULT_GDBSTUB_PORT "1234"
+
+/* GDB breakpoint/watchpoint types */
+#define GDB_BREAKPOINT_SW        0
+#define GDB_BREAKPOINT_HW        1
+#define GDB_WATCHPOINT_WRITE     2
+#define GDB_WATCHPOINT_READ      3
+#define GDB_WATCHPOINT_ACCESS    4
+
+#endif /* GDBSTUB_ENUMS_H */
index 45ee3a9e1fa29ed197a20af1a79cb04c1fed6e89..f601d06ab89cdc5c9eeb580f9a44b3611904c706 100644 (file)
@@ -15,8 +15,9 @@
 
 #include "qemu/osdep.h"
 #include "exec/address-spaces.h"
-#include "exec/gdbstub.h"
 #include "exec/ioport.h"
+#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "monitor/hmp.h"
 #include "qemu/help_option.h"
 #include "monitor/monitor-internal.h"
index a3eede5fa5b86d8a0a6b8331331a414b0d4cead5..cfcb674425ebbf0af1c6a7e209af47e75516dee3 100644 (file)
@@ -68,6 +68,7 @@
 #include "sysemu/numa.h"
 #include "sysemu/hostmem.h"
 #include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "qemu/timer.h"
 #include "chardev/char.h"
 #include "qemu/bitmap.h"
index 45e2218be581d5ae652147b948e14d5a7e8e1372..ef9bc42738d04cd19aa313f422381728c08bbe68 100644 (file)
@@ -33,7 +33,7 @@
 #include "trace/trace-target_arm_hvf.h"
 #include "migration/vmstate.h"
 
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 
 #define MDSCR_EL1_SS_SHIFT  0
 #define MDSCR_EL1_MDE_SHIFT 15
index ebde2899cd882a8028ef323bf31715d506636534..f120d55caabffc4a6c1ca29b9dc19d2fcb1ddabd 100644 (file)
@@ -12,7 +12,7 @@
 #include "qemu/osdep.h"
 #include "cpu.h"
 #include "internals.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 
 /* Maximum and current break/watch point counts */
 int max_hw_bps, max_hw_wps;
index 7cf5cf31dec434dcc9e563901ef05fb3ba1bca8a..70f79eda33cddfb3b3d75b6bb6ba3d5a9f32c7e2 100644 (file)
@@ -31,7 +31,7 @@
 #include "hw/pci/pci.h"
 #include "exec/memattrs.h"
 #include "exec/address-spaces.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "hw/boards.h"
 #include "hw/irq.h"
 #include "qapi/visitor.h"
index 7ad80727489bab79dda45eb14fd898993cbb9c7f..dd8b0f331364230d44dc38fe35d4ca4bda698247 100644 (file)
@@ -38,7 +38,7 @@
 #include "hyperv.h"
 #include "hyperv-proto.h"
 
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "qemu/host-utils.h"
 #include "qemu/main-loop.h"
 #include "qemu/ratelimit.h"
index 005f2239f38ba41d5d264aebfe7f6b210ac3cfb3..2c3932200b25ff1e9fcbc8fb432636a673a18199 100644 (file)
@@ -39,7 +39,7 @@
 #include "migration/qemu-file-types.h"
 #include "sysemu/watchdog.h"
 #include "trace.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "exec/memattrs.h"
 #include "exec/ram_addr.h"
 #include "sysemu/hostmem.h"
index 1b494ecc20766aae1d3ecef2bf33638d34a6730f..94181d9281f5a246e21fe434a5171132733a4b5c 100644 (file)
@@ -40,7 +40,7 @@
 #include "sysemu/hw_accel.h"
 #include "sysemu/runstate.h"
 #include "sysemu/device_tree.h"
-#include "exec/gdbstub.h"
+#include "gdbstub/enums.h"
 #include "exec/ram_addr.h"
 #include "trace.h"
 #include "hw/s390x/s390-pci-inst.h"