From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43492) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKoA6-0007pv-GK for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:09:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKo9v-0001Jh-Ma for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:09:30 -0500 Received: from mail-pb0-x229.google.com ([2607:f8b0:400e:c01::229]:50015) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKo9v-0001Jb-Do for qemu-devel@nongnu.org; Tue, 04 Mar 2014 07:09:19 -0500 Received: by mail-pb0-f41.google.com with SMTP id jt11so5141131pbb.14 for ; Tue, 04 Mar 2014 04:09:18 -0800 (PST) Message-ID: <5315C269.4000602@gmail.com> Date: Tue, 04 Mar 2014 20:09:13 +0800 From: Xuebing wang MIME-Version: 1.0 References: <1393901250-3922-1-git-send-email-xbing6@gmail.com> <1393901250-3922-3-git-send-email-xbing6@gmail.com> <5315A89F.40700@redhat.com> In-Reply-To: <5315A89F.40700@redhat.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [Discussion 02/10] NEED_CPU_H: remove '#include "cpu.h"' from include/qemu-common.h List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini , qemu-devel@nongnu.org Cc: afaerber@suse.de, stefanha@redhat.com >> 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?