Skip to content

Commit d77c4a9

Browse files
Don't set breakpoints on disabled harts
1 parent 689d0fc commit d77c4a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/target/riscv/riscv-013.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,9 @@ static int add_trigger(struct target *target, struct trigger *trigger)
832832

833833
uint64_t tdata1_rb;
834834
for (int hartid = 0; hartid < riscv_count_harts(target); ++hartid) {
835+
if (!riscv_hart_enabled(target, i))
836+
continue;
837+
835838
riscv_set_current_hartid(target, hartid);
836839

837840
if (hartid > 0) {
@@ -918,6 +921,9 @@ static int remove_trigger(struct target *target, struct trigger *trigger)
918921
}
919922
LOG_DEBUG("Stop using resource %d for bp %d", i, trigger->unique_id);
920923
for (int hartid = 0; hartid < riscv_count_harts(target); ++hartid) {
924+
if (!riscv_hart_enabled(target, i))
925+
continue;
926+
921927
riscv_set_current_hartid(target, hartid);
922928
register_write_direct(target, GDB_REGNO_TSELECT, i);
923929
register_write_direct(target, GDB_REGNO_TDATA1, 0);

0 commit comments

Comments
 (0)