Skip to content

Commit

Permalink
riscv_debug: Cleaned up the nomenclature of riscv_halt_poll()'s halt …
Browse files Browse the repository at this point in the history
…causes enum
  • Loading branch information
dragonmux committed Feb 11, 2023
1 parent 70713f0 commit e4d1db7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/target/riscv_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@
typedef enum riscv_halt_cause {
/* Halt was caused by an `ebreak` instruction executing */
RV_HALT_CAUSE_EBREAK = (1U << 6U),
/* Halt was caused by a breakpoint (set in the trigger module) */
RV_HALT_CAUSE_BREAKPOINT = (2U << 6U),
/* Halt was caused by a breakpoint or watchpoint (set in the trigger module) */
RV_HALT_CAUSE_TRIGGER = (2U << 6U),
/* Halt was caused by debugger request (haltreq) */
RV_HALT_CAUSE_REQUEST = (3U << 6U),
/* Halt was caused by single-step execution */
Expand Down Expand Up @@ -919,7 +919,8 @@ static target_halt_reason_e riscv_halt_poll(target_s *const target, target_addr_
status &= RV_DCSR_CAUSE_MASK;
/* Dispatch on the cause code */
switch (status) {
case RV_HALT_CAUSE_BREAKPOINT:
case RV_HALT_CAUSE_TRIGGER:
/* XXX: Need to read out the triggers to find the one causing this, and grab the watch value */
return TARGET_HALT_BREAKPOINT;
case RV_HALT_CAUSE_STEP:
return TARGET_HALT_STEPPING;
Expand Down

0 comments on commit e4d1db7

Please sign in to comment.