Merge pull request #1046 from en-sc/en-sc/reg-rv011-segfault-propper
target/riscv/riscv-011.c: fix access to non-existent register
This commit is contained in:
commit
de03da8c2c
|
@ -1771,10 +1771,10 @@ static riscv_error_t handle_halt_routine(struct target *target)
|
||||||
reg = S0;
|
reg = S0;
|
||||||
break;
|
break;
|
||||||
case 31:
|
case 31:
|
||||||
reg = CSR_DPC;
|
reg = GDB_REGNO_DPC;
|
||||||
break;
|
break;
|
||||||
case 32:
|
case 32:
|
||||||
reg = CSR_DCSR;
|
reg = GDB_REGNO_DCSR;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
@ -1808,8 +1808,8 @@ static riscv_error_t handle_halt_routine(struct target *target)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO: get rid of those 2 variables and talk to the cache directly. */
|
/* TODO: get rid of those 2 variables and talk to the cache directly. */
|
||||||
info->dpc = reg_cache_get(target, CSR_DPC);
|
info->dpc = reg_cache_get(target, GDB_REGNO_DPC);
|
||||||
info->dcsr = reg_cache_get(target, CSR_DCSR);
|
info->dcsr = reg_cache_get(target, GDB_REGNO_DCSR);
|
||||||
|
|
||||||
cache_invalidate(target);
|
cache_invalidate(target);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue