From 4411d1f4c2d36ece06421b02e986abe0d9f19714 Mon Sep 17 00:00:00 2001 From: Tim Newsome Date: Wed, 17 Jun 2020 12:18:25 -0700 Subject: [PATCH] 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 --- src/target/riscv/riscv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index aa0029556..bd6482121 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;