From c8430bb8f452a5f291edf6599263c496da3241b7 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Fri, 10 Jun 2016 13:25:55 -0700 Subject: [PATCH] DebugTest.test_interrupt passes now. --- src/target/riscv/riscv.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 5a7469714..66519ae7c 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -962,7 +962,6 @@ static int riscv_examine(struct target *target) static int handle_halt(struct target *target) { - target_call_event_callbacks(target, TARGET_EVENT_HALTED); target->state = TARGET_HALTED; uint32_t dpc; @@ -975,6 +974,7 @@ static int handle_halt(struct target *target) return ERROR_FAIL; } int cause = get_field(dcsr, DCSR_CAUSE); + LOG_DEBUG("halt cause is %d; dcsr=0x%x", cause, dcsr); switch (cause) { case DCSR_CAUSE_SWBP: case DCSR_CAUSE_HWBP: @@ -992,6 +992,8 @@ static int handle_halt(struct target *target) cause, dcsr); } + target_call_event_callbacks(target, TARGET_EVENT_HALTED); + LOG_DEBUG("halted at 0x%x", dpc); return ERROR_OK;