[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 13/16] target-or32: Add gdb stub
From: |
Jia Liu |
Subject: |
[Qemu-devel] [PATCH v3 13/16] target-or32: Add gdb stub |
Date: |
Wed, 6 Jun 2012 20:27:09 +0800 |
Add gdb stub for OpenRISC.
Signed-off-by: Jia Liu <address@hidden>
---
gdbstub.c | 64 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/gdbstub.c b/gdbstub.c
index 6a77a66..28c5220 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1155,6 +1155,68 @@ static int cpu_gdb_write_register(CPUMIPSState *env,
uint8_t *mem_buf, int n)
return sizeof(target_ulong);
}
+#elif defined(TARGET_OPENRISC)
+
+#define NUM_CORE_REGS (32 + 3)
+
+static int cpu_gdb_read_register(CPUOpenRISCState *env, uint8_t *mem_buf, int
n)
+{
+ if (n < 32) {
+ GET_REG32(env->gpr[n]);
+ } else {
+ switch (n) {
+ case 32: /* PPC */
+ GET_REG32(env->ppc);
+ break;
+
+ case 33: /* NPC */
+ GET_REG32(env->npc);
+ break;
+
+ case 34: /* SR */
+ GET_REG32(env->sr);
+ break;
+
+ default:
+ break;
+ }
+ }
+ return 0;
+}
+
+static int cpu_gdb_write_register(CPUOpenRISCState *env,
+ uint8_t *mem_buf, int n)
+{
+ uint32_t tmp;
+
+ if (n > NUM_CORE_REGS) {
+ return 0;
+ }
+
+ tmp = ldl_p(mem_buf);
+
+ if (n < 32) {
+ env->gpr[n] = tmp;
+ } else {
+ switch (n) {
+ case 32: /* PPC */
+ env->ppc = tmp;
+ break;
+
+ case 33: /* NPC */
+ env->npc = tmp;
+ break;
+
+ case 34: /* SR */
+ env->sr = tmp;
+ break;
+
+ default:
+ break;
+ }
+ }
+ return 4;
+}
#elif defined (TARGET_SH4)
/* Hint: Use "set architecture sh4" in GDB to see fpu registers */
@@ -1924,6 +1986,8 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulong pc)
}
#elif defined (TARGET_MICROBLAZE)
s->c_cpu->sregs[SR_PC] = pc;
+#elif defined(TARGET_OPENRISC)
+ s->c_cpu->pc = pc;
#elif defined (TARGET_CRIS)
s->c_cpu->pc = pc;
#elif defined (TARGET_ALPHA)
--
1.7.9.5
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, (continued)
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Jia Liu, 2012/06/07
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Wei-Ren Chen, 2012/06/07
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Max Filippov, 2012/06/08
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Andreas Färber, 2012/06/08
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Andreas Färber, 2012/06/08
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Jia Liu, 2012/06/08
- Re: [Qemu-devel] [PATCH v3 08/16] target-or32: Add translation routines, Jia Liu, 2012/06/08
[Qemu-devel] [PATCH v3 09/16] target-or32: Add PIC support, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 11/16] target-or32: Add a IIS dummy board, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 12/16] target-or32: Add system instruction helpers, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 13/16] target-or32: Add gdb stub,
Jia Liu <=
[Qemu-devel] [PATCH v3 14/16] target-or32: Add linux syscall, signal and termbits, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 15/16] target-or32: Add linux user support, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 10/16] target-or32: Add timer, Jia Liu, 2012/06/06
[Qemu-devel] [PATCH v3 16/16] target-or32: Add testcases, Jia Liu, 2012/06/06