Skip to contentSkip to conversation

target-moxie: Add gdbstub support

PATCH New Anthony Green 1 participant 1 message Dec 15, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 target-moxie: Add gdbstub support

This patch adds gdbstub support for the moxie target port.

---
 target-moxie/Makefile.objs |  1 +
 target-moxie/cpu.c         |  3 +++
 target-moxie/cpu.h         |  2 ++
 target-moxie/gdbstub.c     | 56 ++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 62 insertions(+)
 create mode 100644 target-moxie/gdbstub.c
target-moxie/Makefile.objs +1 -0
index 6381d4d..9a690fb 100644
@@ -1,2 +1,3 @@
 obj-y += translate.o helper.o machine.o cpu.o machine.o
+obj-y += gdbstub.o
 obj-$(CONFIG_SOFTMMU) += mmu.o
target-moxie/cpu.c +3 -0
index 484ecc2..e3b7995 100644
@@ -102,10 +102,13 @@ static void moxie_cpu_class_init(ObjectClass *oc, void *data)
     cc->do_interrupt = moxie_cpu_do_interrupt;
     cc->dump_state = moxie_cpu_dump_state;
     cc->set_pc = moxie_cpu_set_pc;
+    cc->gdb_read_register = moxie_cpu_gdb_read_register;
+    cc->gdb_write_register = moxie_cpu_gdb_write_register;
 #ifndef CONFIG_USER_ONLY
     cc->get_phys_page_debug = moxie_cpu_get_phys_page_debug;
     cc->vmsd = &vmstate_moxie_cpu;
 #endif
+    cc->gdb_num_core_regs = 16 + 1;
 }
 
 static void moxielite_initfn(Object *obj)
target-moxie/cpu.h +2 -0
index 5ce14b5..140cbe3 100644
@@ -119,6 +119,8 @@ void moxie_cpu_do_interrupt(CPUState *cs);
 void moxie_cpu_dump_state(CPUState *cpu, FILE *f,
                           fprintf_function cpu_fprintf, int flags);
 hwaddr moxie_cpu_get_phys_page_debug(CPUState *cpu, vaddr addr);
+int moxie_cpu_gdb_read_register(CPUState *cpu, uint8_t *buf, int reg);
+int moxie_cpu_gdb_write_register(CPUState *cpu, uint8_t *buf, int reg);
 void moxie_translate_init(void);
 int cpu_moxie_signal_handler(int host_signum, void *pinfo,
                              void *puc);
target-moxie/gdbstub.c new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.8.3.1