Skip to content

Commit

Permalink
openocd does not allow to query status of dcsr.ebreak{u,s,m}
Browse files Browse the repository at this point in the history
Extend riscv info command output with info about dcsr.ebreak{u,s,m}

Change-Id: Ib46e6b6dfc0117599c7f6715c7aaf113e63bd7dc
Signed-off-by: Kirill Radkin <[email protected]>
  • Loading branch information
kr-sc committed Sep 14, 2023
1 parent 67c2835 commit 14aa682
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/target/riscv/riscv.c
Original file line number Diff line number Diff line change
Expand Up @@ -4196,6 +4196,19 @@ COMMAND_HANDLER(handle_info)
riscv_enumerate_triggers(target) == ERROR_OK;
riscv_print_info_line_if_available(CMD, "hart", "trigger_count",
r->trigger_count, trigger_count_available);
/* dcsr.ebreak flags status */
riscv_print_info_line(CMD, "OpenOCD_flag_dcsr", "ebreakm", riscv_ebreakm);
riscv_print_info_line(CMD, "OpenOCD_flag_dcsr", "ebreaks", riscv_ebreaks);
riscv_print_info_line(CMD, "OpenOCD_flag_dcsr", "ebreaku", riscv_ebreaku);

riscv_reg_t dcsr;

const bool dcsr_read_success = riscv_get_register(target, &dcsr, GDB_REGNO_DCSR) == ERROR_OK;

riscv_print_info_line_if_available(CMD, "dcsr", "ebreakm", get_field(dcsr, CSR_DCSR_EBREAKM), dcsr_read_success);
riscv_print_info_line_if_available(CMD, "dcsr", "ebreaks", get_field(dcsr, CSR_DCSR_EBREAKS), dcsr_read_success);
riscv_print_info_line_if_available(CMD, "dcsr", "ebreaku", get_field(dcsr, CSR_DCSR_EBREAKU), dcsr_read_success);

if (r->print_info)
return CALL_COMMAND_HANDLER(r->print_info, target);

Expand Down

0 comments on commit 14aa682

Please sign in to comment.