[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnost
From: |
Alex Bennée |
Subject: |
[PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs |
Date: |
Thu, 2 Mar 2023 19:08:23 +0000 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
Prototypes using gdb_syscall_complete_cb() or gdb_?et_reg_cb()
don't depend on "cpu.h", thus are not target-specific.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221214143659.62133-1-philmd@linaro.org>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
include/exec/gdbstub.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index f667014888..1636fb3841 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -71,9 +71,6 @@ struct gdb_timeval {
uint64_t tv_usec; /* microsecond */
} QEMU_PACKED;
-#ifdef NEED_CPU_H
-#include "cpu.h"
-
typedef void (*gdb_syscall_complete_cb)(CPUState *cpu, uint64_t ret, int err);
/**
@@ -126,6 +123,7 @@ int gdb_handlesig(CPUState *, int);
void gdb_signalled(CPUArchState *, int);
void gdbserver_fork(CPUState *);
#endif
+
/* Get or set a register. Returns the size of the register. */
typedef int (*gdb_get_reg_cb)(CPUArchState *env, GByteArray *buf, int reg);
typedef int (*gdb_set_reg_cb)(CPUArchState *env, uint8_t *buf, int reg);
@@ -133,6 +131,9 @@ void gdb_register_coprocessor(CPUState *cpu,
gdb_get_reg_cb get_reg, gdb_set_reg_cb set_reg,
int num_regs, const char *xml, int g_pos);
+#ifdef NEED_CPU_H
+#include "cpu.h"
+
/*
* The GDB remote protocol transfers values in target byte order. As
* the gdbstub may be batching up several register values we always
--
2.39.2
- [PATCH v4 00/26] gdbstub/next: re-organise and split build, Alex Bennée, 2023/03/02
- [PATCH v4 01/26] gdbstub/internals.h: clean up include guard, Alex Bennée, 2023/03/02
- [PATCH v4 02/26] gdbstub: fix-up copyright and license files, Alex Bennée, 2023/03/02
- [PATCH v4 03/26] gdbstub: Make syscall_complete/[gs]et_reg target-agnostic typedefs,
Alex Bennée <=
- [PATCH v4 07/26] includes: move tb_flush into its own header, Alex Bennée, 2023/03/02
- [PATCH v4 05/26] gdbstub: define separate user/system structures, Alex Bennée, 2023/03/02
- [PATCH v4 06/26] gdbstub: move GDBState to shared internals header, Alex Bennée, 2023/03/02
- [PATCH v4 08/26] gdbstub: move fromhex/tohex routines to internals, Alex Bennée, 2023/03/02
- [PATCH v4 04/26] gdbstub: clean-up indent on gdb_exit, Alex Bennée, 2023/03/02
- [PATCH v4 12/26] gdbstub: rationalise signal mapping in softmmu, Alex Bennée, 2023/03/02
- [PATCH v4 10/26] gdbstub: move chunk of softmmu functionality to own file, Alex Bennée, 2023/03/02
- [PATCH v4 09/26] gdbstub: make various helpers visible to the rest of the module, Alex Bennée, 2023/03/02
- [PATCH v4 11/26] gdbstub: move chunks of user code into own files, Alex Bennée, 2023/03/02