diff options
author | Tim Newsome <tim@sifive.com> | 2018-01-04 13:27:18 -0800 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2018-01-04 13:27:18 -0800 |
commit | 07e19e17cbbee22533d9fccb5a6dde523e4baa04 (patch) | |
tree | d8ebfbea2504774cf1ccac6d0b5d55daf6e83de0 /src | |
parent | 82529e71e0e686d11dcf4c505d13d5c6b3da9d73 (diff) | |
download | riscv-openocd-07e19e17cbbee22533d9fccb5a6dde523e4baa04.zip riscv-openocd-07e19e17cbbee22533d9fccb5a6dde523e4baa04.tar.gz riscv-openocd-07e19e17cbbee22533d9fccb5a6dde523e4baa04.tar.bz2 |
Use register names instead of numbers in warnings
Change-Id: Ie2295d30fd9dfeb7590f5e34d572497a93a3ce7b
Diffstat (limited to 'src')
-rw-r--r-- | src/target/riscv/riscv-011.c | 10 | ||||
-rw-r--r-- | src/target/riscv/riscv.c | 1 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/target/riscv/riscv-011.c b/src/target/riscv/riscv-011.c index 18e31c7..aa14a2b 100644 --- a/src/target/riscv/riscv-011.c +++ b/src/target/riscv/riscv-011.c @@ -997,7 +997,8 @@ static int read_csr(struct target *target, uint64_t *value, uint32_t csr) uint32_t exception = cache_get32(target, info->dramsize-1); if (exception) { - LOG_WARNING("Got exception 0x%x when reading CSR 0x%x", exception, csr); + LOG_WARNING("Got exception 0x%x when reading %s", exception, + gdb_regno_name(GDB_REGNO_CSR0 + csr)); *value = ~0; return ERROR_FAIL; } @@ -1202,8 +1203,7 @@ static int register_read(struct target *target, riscv_reg_t *value, int regnum) uint32_t exception = cache_get32(target, info->dramsize-1); if (exception) { - LOG_WARNING("Got exception 0x%x when reading register %d", exception, - regnum); + LOG_WARNING("Got exception 0x%x when reading %s", exception, gdb_regno_name(regnum)); *value = ~0; return ERROR_FAIL; } @@ -1277,8 +1277,8 @@ static int register_write(struct target *target, unsigned int number, uint32_t exception = cache_get32(target, info->dramsize-1); if (exception) { - LOG_WARNING("Got exception 0x%x when writing register %d", exception, - number); + LOG_WARNING("Got exception 0x%x when writing %s", exception, + gdb_regno_name(number)); return ERROR_FAIL; } diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 009bc3a..1c0f185 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -2140,4 +2140,3 @@ int riscv_init_registers(struct target *target) return ERROR_OK; } - |