Print dcsr.cause always (#617)

Minor change/debug print: Made sure that dcsr.cause is printed
into the log always.
This commit is contained in:
Jan Matyas 2021-06-07 21:40:58 +02:00 committed by GitHub
parent 3249d41559
commit 0211e6bf4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

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