Remove unable to read register error message
It confuses users of IDEs like Eclipse, which request to read registers that don't exist on the target. Fixes #176 Change-Id: Ie2504140bfc70eba0d88fd763aacd87895aa20ff
This commit is contained in:
parent
5767fa8e04
commit
1d00d03dc0
|
@ -2386,21 +2386,17 @@ static int riscv013_get_register(struct target *target,
|
|||
riscv_set_current_hartid(target, hid);
|
||||
|
||||
int result = ERROR_OK;
|
||||
if (rid <= GDB_REGNO_XPR31) {
|
||||
result = register_read_direct(target, value, rid);
|
||||
} else if (rid == GDB_REGNO_PC) {
|
||||
if (rid == GDB_REGNO_PC) {
|
||||
result = register_read_direct(target, value, GDB_REGNO_DPC);
|
||||
LOG_DEBUG("read PC from DPC: 0x%016" PRIx64, *value);
|
||||
} else if (rid == GDB_REGNO_PRIV) {
|
||||
uint64_t dcsr;
|
||||
result = register_read_direct(target, &dcsr, GDB_REGNO_DCSR);
|
||||
buf_set_u64((unsigned char *)value, 0, 8, get_field(dcsr, CSR_DCSR_PRV));
|
||||
*value = get_field(dcsr, CSR_DCSR_PRV);
|
||||
} else {
|
||||
result = register_read_direct(target, value, rid);
|
||||
if (result != ERROR_OK) {
|
||||
LOG_ERROR("Unable to read %s", gdb_regno_name(rid));
|
||||
if (result != ERROR_OK)
|
||||
*value = -1;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue