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);
|
riscv_set_current_hartid(target, hid);
|
||||||
|
|
||||||
int result = ERROR_OK;
|
int result = ERROR_OK;
|
||||||
if (rid <= GDB_REGNO_XPR31) {
|
if (rid == GDB_REGNO_PC) {
|
||||||
result = register_read_direct(target, value, rid);
|
|
||||||
} else if (rid == GDB_REGNO_PC) {
|
|
||||||
result = register_read_direct(target, value, GDB_REGNO_DPC);
|
result = register_read_direct(target, value, GDB_REGNO_DPC);
|
||||||
LOG_DEBUG("read PC from DPC: 0x%016" PRIx64, *value);
|
LOG_DEBUG("read PC from DPC: 0x%016" PRIx64, *value);
|
||||||
} else if (rid == GDB_REGNO_PRIV) {
|
} else if (rid == GDB_REGNO_PRIV) {
|
||||||
uint64_t dcsr;
|
uint64_t dcsr;
|
||||||
result = register_read_direct(target, &dcsr, GDB_REGNO_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 {
|
} else {
|
||||||
result = register_read_direct(target, value, rid);
|
result = register_read_direct(target, value, rid);
|
||||||
if (result != ERROR_OK) {
|
if (result != ERROR_OK)
|
||||||
LOG_ERROR("Unable to read %s", gdb_regno_name(rid));
|
|
||||||
*value = -1;
|
*value = -1;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Reference in New Issue