qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"


From: Xuebing wang
Subject: Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"' from include/qemu-common.h
Date: Tue, 04 Mar 2014 20:09:13 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0


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

[Prev in Thread] Current Thread [Next in Thread]