diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index a608a26..14addcb 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -11,6 +11,8 @@
 #define GDB_WATCHPOINT_ACCESS    4

 #ifdef NEED_CPU_H
+#include "cpu.h" /* target-xxx/cpu.h, required for target_ulong,
+                    CPUArchState */
 typedef void (*gdb_syscall_complete_cb)(CPUState *cpu,
target_ulong ret, target_ulong err);

@@ -76,7 +78,7 @@ static inline int gdb_get_reg64(uint8_t *mem_buf, uint64_t val)
 #define ldtul_p(addr) ldl_p(addr)
 #endif

-#endif
+#endif /* NEED_CPU_H */

 #ifdef CONFIG_USER_ONLY
 int gdbserver_start(int);

Same here: I'd rather add a cpu.h inclusion to the following files:

cpus.c
target-alpha/gdbstub.c
target-arm/gdbstub.c
target-arm/gdbstub64.c
target-cris/gdbstub.c
target-i386/gdbstub.c
target-lm32/gdbstub.c
target-m68k/gdbstub.c
target-microblaze/gdbstub.c
target-mips/gdbstub.c
target-openrisc/gdbstub.c
target-ppc/gdbstub.c
target-ppc/translate_init.c
target-s390x/gdbstub.c
target-sh4/gdbstub.c
target-sparc/gdbstub.c
target-xtensa/gdbstub.c


I personally prefer keeping gdbstub.h correct by itself. I am not sure if this is only my personal preference or not.

target-*/gdbstub.c implementers only need to know gdbstub hooks (thus gdbstub API), they don't care "cpu.h", although knowledge of "cpu.h" helps.

Agree?



Reply via email to