Fix trigger set/clear bug.

travis-nop
Tim Newsome 2017-07-03 11:52:35 -07:00
parent d77c4a953c
commit f18fd83ac7
1 changed files with 2 additions and 2 deletions

View File

@ -832,7 +832,7 @@ static int add_trigger(struct target *target, struct trigger *trigger)
uint64_t tdata1_rb;
for (int hartid = 0; hartid < riscv_count_harts(target); ++hartid) {
if (!riscv_hart_enabled(target, i))
if (!riscv_hart_enabled(target, hartid))
continue;
riscv_set_current_hartid(target, hartid);
@ -921,7 +921,7 @@ static int remove_trigger(struct target *target, struct trigger *trigger)
}
LOG_DEBUG("Stop using resource %d for bp %d", i, trigger->unique_id);
for (int hartid = 0; hartid < riscv_count_harts(target); ++hartid) {
if (!riscv_hart_enabled(target, i))
if (!riscv_hart_enabled(target, hartid))
continue;
riscv_set_current_hartid(target, hartid);