Skip to content

Commit

Permalink
Don't set breakpoints on disabled harts
Browse files Browse the repository at this point in the history
  • Loading branch information
palmer-dabbelt committed Jun 21, 2017
1 parent 689d0fc commit d77c4a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,9 @@ 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))
continue;

riscv_set_current_hartid(target, hartid);

if (hartid > 0) {
Expand Down Expand Up @@ -918,6 +921,9 @@ 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))
continue;

riscv_set_current_hartid(target, hartid);
register_write_direct(target, GDB_REGNO_TSELECT, i);
register_write_direct(target, GDB_REGNO_TDATA1, 0);
Expand Down

0 comments on commit d77c4a9

Please sign in to comment.