Fix off-by-one error.

This commit is contained in:
Tim Newsome 2017-08-26 18:25:10 -07:00
parent eef9442aa7
commit 5f53655e65
1 changed files with 2 additions and 2 deletions

View File

@ -1430,9 +1430,9 @@ static int read_memory(struct target *target, target_addr_t address,
switch (riscv_xlen(target)) { switch (riscv_xlen(target)) {
case 64: case 64:
riscv013_write_debug_buffer(target, d_addr + 1, (cur_addr - size) >> 32); riscv013_write_debug_buffer(target, d_addr + 1, cur_addr >> 32);
case 32: case 32:
riscv013_write_debug_buffer(target, d_addr, (cur_addr - size)); riscv013_write_debug_buffer(target, d_addr, cur_addr);
break; break;
default: default:
LOG_ERROR("unknown XLEN %d", riscv_xlen(target)); LOG_ERROR("unknown XLEN %d", riscv_xlen(target));