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:
Tim Newsome 2018-03-02 19:41:31 -08:00
parent 5767fa8e04
commit 1d00d03dc0
1 changed files with 3 additions and 7 deletions

View File

@ -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;