qemu-ppc
[Top][All Lists]
Advanced

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

Re: [Qemu-ppc] [Qemu-devel] [PULL 07/32] PPC: Add support for Apple gdb


From: Alexander Graf
Subject: Re: [Qemu-ppc] [Qemu-devel] [PULL 07/32] PPC: Add support for Apple gdb in gdbstub
Date: Wed, 02 Jul 2014 09:33:46 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0


On 02.07.14 05:34, Programmingkid wrote:
The Apple gdbstub protocol is different from the normal gdbstub protocol
used on PowerPC. Add support for the different variant, so that we can use
Apple's gdb to debug guest code.

Keep in mind that the switch is a compile time option. We can't detect
during runtime whether a gdb connecting to us is an upstream gdb or an
Apple gdb.

Wouldn't it be better to assume we are using Apple's GDB? Building the powerpc-apple-darwin target of gdb is not supported.

Why would we assume that any user wants to run the broken Apple gdb?

//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
//#define PPC_DUMP_SPR_ACCESSES
+/* #define USE_APPLE_GDB */

Users are not going to be able to find these options very easily. Using a condition to test for Mac OS X would solve this problem:

#if defined(__APPLE__)

    #define PPC_DUMP_CPU
    #define PPC_DEBUG_SPR
    #define PPC_DUMP_SPR_ACCESSES
    #define USE_APPLE_GDB

#endif

Eh. These defines are there for very specific debug purposes. I don't see why it would make sense to enable any of them by default just because we happen to run on an Apple host system.

When I uncommented the "#define PPC_DUMP_CPU" code, there were a lot of build errors on Mac OS X. They all had a message like this:

/target-ppc/translate_init.c:8729: error: ‘opc_handler_t’ has no member named ‘oname’

Ah, the joy of #ifdef'ed code :). I guess nobody used those debug features in a while. Feel free to send fixes ;).

But really, there is *no* correlation at all between the fact that a user wants to use an Apple gdb to debug a target and that QEMU happens to run on an Apple host system.


Alex




reply via email to

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