aboutsummaryrefslogtreecommitdiff
path: root/gdbstub.c
diff options
context:
space:
mode:
authorEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-02-20 19:51:56 +0100
committerEdgar E. Iglesias <edgar.iglesias@gmail.com>2010-02-20 19:51:56 +0100
commit4a0b59fe3b245f972a764d276df45ccd23e81972 (patch)
tree7a6a3190e63ee3d248302aabb9d95f0acb721fd5 /gdbstub.c
parent4ffb9ae2e1227d2ffa14355acbecd37677fe0374 (diff)
downloadqemu-4a0b59fe3b245f972a764d276df45ccd23e81972.zip
qemu-4a0b59fe3b245f972a764d276df45ccd23e81972.tar.gz
qemu-4a0b59fe3b245f972a764d276df45ccd23e81972.tar.bz2
cris: Add CRISv10 gdbstub support.
Signed-off-by: Edgar E. Iglesias <edgar.iglesias@gmail.com>
Diffstat (limited to 'gdbstub.c')
-rw-r--r--gdbstub.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/gdbstub.c b/gdbstub.c
index 80477be..91c5f68 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1249,10 +1249,46 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
#define NUM_CORE_REGS 49
+static int
+read_register_crisv10(CPUState *env, uint8_t *mem_buf, int n)
+{
+ if (n < 15) {
+ GET_REG32(env->regs[n]);
+ }
+
+ if (n == 15) {
+ GET_REG32(env->pc);
+ }
+
+ if (n < 32) {
+ switch (n) {
+ case 16:
+ GET_REG8(env->pregs[n - 16]);
+ break;
+ case 17:
+ GET_REG8(env->pregs[n - 16]);
+ break;
+ case 20:
+ case 21:
+ GET_REG16(env->pregs[n - 16]);
+ break;
+ default:
+ if (n >= 23) {
+ GET_REG32(env->pregs[n - 16]);
+ }
+ break;
+ }
+ }
+ return 0;
+}
+
static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
{
uint8_t srs;
+ if (env->pregs[PR_VR] < 32)
+ return read_register_crisv10(env, mem_buf, n);
+
srs = env->pregs[PR_SRS];
if (n < 16) {
GET_REG32(env->regs[n]);