diff options
author | Tim Newsome <tim@sifive.com> | 2021-05-12 11:43:26 -0700 |
---|---|---|
committer | Tim Newsome <tim@sifive.com> | 2021-05-12 11:44:32 -0700 |
commit | 8fcc19d70b8f8d9fac4c425f4119fa9aa663a73f (patch) | |
tree | 55cb8a99f438fced869b1943e76d58a3c04e53d4 /src | |
parent | dd3dea88f70709103387458848240e07597c6f3c (diff) | |
download | riscv-openocd-8fcc19d70b8f8d9fac4c425f4119fa9aa663a73f.zip riscv-openocd-8fcc19d70b8f8d9fac4c425f4119fa9aa663a73f.tar.gz riscv-openocd-8fcc19d70b8f8d9fac4c425f4119fa9aa663a73f.tar.bz2 |
Keep alive when accessing registers.
With the bitbang performance decrease and talking to slower targets
(daisy chain spike) we more often don't meet the expected keepalive time
for gdb. This addresses the cases I ran into.
Change-Id: Ie69c2c602c3be9c156e508fdfa6d0178f104e1d8
Signed-off-by: Tim Newsome <tim@sifive.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/target/riscv/riscv.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/target/riscv/riscv.c b/src/target/riscv/riscv.c index 4b8b804..a8838d9 100644 --- a/src/target/riscv/riscv.c +++ b/src/target/riscv/riscv.c @@ -3513,6 +3513,8 @@ int riscv_set_register(struct target *target, enum gdb_regno regid, riscv_reg_t LOG_DEBUG("[%s] %s <- %" PRIx64, target_name(target), gdb_regno_name(regid), value); assert(r->set_register); + keep_alive(); + /* TODO: Hack to deal with gdb that thinks these registers still exist. */ if (regid > GDB_REGNO_XPR15 && regid <= GDB_REGNO_XPR31 && value == 0 && riscv_supports_extension(target, 'E')) @@ -3536,6 +3538,8 @@ int riscv_get_register(struct target *target, riscv_reg_t *value, { RISCV_INFO(r); + keep_alive(); + struct reg *reg = &target->reg_cache->reg_list[regid]; if (!reg->exist) { LOG_DEBUG("[%s] %s does not exist.", |