summaryrefslogtreecommitdiffstats
path: root/target-ppc/translate_init.c
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2014-06-23 15:23:08 +0200
committerAlexander Graf <agraf@suse.de>2014-06-27 13:48:22 +0200
commitb3cad3abf6df07db165091343b912c2a5de63c26 (patch)
treed010a10efa2e67806871326459b79fd4206ad98d /target-ppc/translate_init.c
parent294d1292893867894992e810a01cfcfa451f1885 (diff)
downloadhqemu-b3cad3abf6df07db165091343b912c2a5de63c26.zip
hqemu-b3cad3abf6df07db165091343b912c2a5de63c26.tar.gz
PPC: Add support for Apple gdb in gdbstub
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. Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc/translate_init.c')
-rw-r--r--target-ppc/translate_init.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 85581c9..594f7ac 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -34,6 +34,7 @@
//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
//#define PPC_DUMP_SPR_ACCESSES
+/* #define USE_APPLE_GDB */
/* For user-mode emulation, we don't emulate any IRQ controller */
#if defined(CONFIG_USER_ONLY)
@@ -9667,6 +9668,13 @@ static void ppc_cpu_class_init(ObjectClass *oc, void *data)
#endif
cc->gdb_num_core_regs = 71;
+
+#ifdef USE_APPLE_GDB
+ cc->gdb_read_register = ppc_cpu_gdb_read_register_apple;
+ cc->gdb_write_register = ppc_cpu_gdb_write_register_apple;
+ cc->gdb_num_core_regs = 71 + 32;
+#endif
+
#if defined(TARGET_PPC64)
cc->gdb_core_xml_file = "power64-core.xml";
#else
OpenPOWER on IntegriCloud