diff options
author | Palmer Dabbelt <palmer@dabbelt.com> | 2017-06-21 10:16:25 -0700 |
---|---|---|
committer | Palmer Dabbelt <palmer@dabbelt.com> | 2017-06-21 12:25:20 -0700 |
commit | d77c4a953c1f2a6e1f84c28e64bf9296a4bb398a (patch) | |
tree | 4099f8344cc8e11ae9d967d1c0a798e8c4ed3b17 | |
parent | 689d0fcaf6764b6a8efbbfed51e048a94c03f3bf (diff) | |
download | riscv-openocd-d77c4a953c1f2a6e1f84c28e64bf9296a4bb398a.zip riscv-openocd-d77c4a953c1f2a6e1f84c28e64bf9296a4bb398a.tar.gz riscv-openocd-d77c4a953c1f2a6e1f84c28e64bf9296a4bb398a.tar.bz2 |
Don't set breakpoints on disabled hartsv20170621
-rw-r--r-- | src/target/riscv/riscv-013.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c index a68a1c7..86f5f1b 100644 --- a/src/target/riscv/riscv-013.c +++ b/src/target/riscv/riscv-013.c @@ -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) { @@ -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); |