aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Newsome <tim@sifive.com>2021-07-22 11:43:51 -0700
committerTim Newsome <tim@sifive.com>2021-07-22 11:44:38 -0700
commit83a87b2ccc9e6e2f0bcf20bc56bb4f6759392aa6 (patch)
tree46c3f88d5eb0b92df05efd0e3b24c0305521ecfb
parentf30837f04ce1c3203ebd32f11baa2277f597550b (diff)
downloadriscv-openocd-s2_increment.zip
riscv-openocd-s2_increment.tar.gz
riscv-openocd-s2_increment.tar.bz2
Fix clobbering s2 in read_memory_progbuf(increment=0)s2_increment
Fixes #632. Change-Id: Ic884823faf67749f1ac8fbd91fe67ff9ebdd8fd0 Signed-off-by: Tim Newsome <tim@sifive.com>
-rw-r--r--src/target/riscv/riscv-013.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/target/riscv/riscv-013.c b/src/target/riscv/riscv-013.c
index 4b9bd93..8766795 100644
--- a/src/target/riscv/riscv-013.c
+++ b/src/target/riscv/riscv-013.c
@@ -3457,7 +3457,7 @@ static int read_memory_progbuf(struct target *target, target_addr_t address,
return ERROR_FAIL;
if (register_read(target, &s1, GDB_REGNO_S1) != ERROR_OK)
return ERROR_FAIL;
- if (increment == 0 && register_read(target, &s2, GDB_REGNO_S1) != ERROR_OK)
+ if (increment == 0 && register_read(target, &s2, GDB_REGNO_S2) != ERROR_OK)
return ERROR_FAIL;
/* Write the program (load, increment) */