diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 4b33eb7607..84bedf68ad 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -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);