aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2020-06-17 12:18:25 -0700
committerTim Newsome <tim@sifive.com>2020-06-17 12:18:25 -0700
commit4411d1f4c2d36ece06421b02e986abe0d9f19714 (patch)
tree9120504ee781eac62bf7a2bfeb37b6ec735047b9
parent8c1fedb8806f865f90f6d99b5c3a901b42ea5725 (diff)
downloadriscv-openocd-4411d1f4c2d36ece06421b02e986abe0d9f19714.zip
riscv-openocd-4411d1f4c2d36ece06421b02e986abe0d9f19714.tar.gz
riscv-openocd-4411d1f4c2d36ece06421b02e986abe0d9f19714.tar.bz2
Enumerate triggers when resuming from a trigger
Otherwise when we connect to a target that's already halted due to a trigger, we won't correctly step past it. Change-Id: I23b9482fa9597af826770f9cebf247b7ba59f65c
-rw-r--r--src/target/riscv/riscv.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c
index aa00295..bd64821 100644
--- a/src/target/riscv/riscv.c
+++ b/src/target/riscv/riscv.c
@@ -1229,6 +1229,9 @@ static int resume_prep(struct target *target, int current,
/* To be able to run off a trigger, disable all the triggers, step, and
* then resume as usual. */
LOG_DEBUG("deal with triggers");
+ if (riscv_enumerate_triggers(target) != ERROR_OK)
+ return ERROR_FAIL;
+
riscv_reg_t trigger_temporarily_cleared[RISCV_MAX_HWBPS] = {0};
int result = ERROR_OK;