diff options
author | Jan Matyas <50193733+JanMatCodasip@users.noreply.github.com> | 2021-06-07 21:40:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-07 12:40:58 -0700 |
commit | 0211e6bf4c9e365fbd33bfbdfc28dd6aa53fbfed (patch) | |
tree | e3b63677e70f2e3f1dac48f6dfe73f8fe8895576 /src/target | |
parent | 3249d415595ee430164aa0429bcc7452c0f251fa (diff) | |
download | riscv-openocd-0211e6bf4c9e365fbd33bfbdfc28dd6aa53fbfed.zip riscv-openocd-0211e6bf4c9e365fbd33bfbdfc28dd6aa53fbfed.tar.gz riscv-openocd-0211e6bf4c9e365fbd33bfbdfc28dd6aa53fbfed.tar.bz2 |
Print dcsr.cause always (#617)
Minor change/debug print: Made sure that dcsr.cause is printed
into the log always.
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/riscv/riscv-013.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index cb963d8..ace3629 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -4325,6 +4325,8 @@ static enum riscv_halt_reason riscv013_halt_reason(struct target *target) if (result != ERROR_OK) return RISCV_HALT_UNKNOWN; + LOG_DEBUG("dcsr.cause: 0x%x", (unsigned int)get_field(dcsr, CSR_DCSR_CAUSE)); + switch (get_field(dcsr, CSR_DCSR_CAUSE)) { case CSR_DCSR_CAUSE_SWBP: return RISCV_HALT_BREAKPOINT; @@ -4344,7 +4346,7 @@ static enum riscv_halt_reason riscv013_halt_reason(struct target *target) return RISCV_HALT_GROUP; } - LOG_ERROR("Unknown DCSR cause field: %x", (int)get_field(dcsr, CSR_DCSR_CAUSE)); + LOG_ERROR("Unknown DCSR cause field: 0x%x", (unsigned int)get_field(dcsr, CSR_DCSR_CAUSE)); LOG_ERROR(" dcsr=0x%016lx", (long)dcsr); return RISCV_HALT_UNKNOWN; } |