Skip to content

Commit 1af0c09

Browse files
authored
Merge pull request #92 from riscv/FE_402_fix
Fe 402 fix
2 parents 96eb73c + 3109da7 commit 1af0c09

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/target/riscv/riscv-013.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,10 @@ static int read_memory(struct target *target, target_addr_t address,
14361436

14371437
if (this_is_last_read && i == start + reads - 1) {
14381438
riscv013_set_autoexec(target, d_data, 0);
1439-
value = riscv_program_read_ram(&program, r_data);
1439+
1440+
// access debug buffer without executing a program - this address logic was taken from program.c
1441+
int const off = (r_data - riscv_debug_buffer_addr(program.target)) / sizeof(program.debug_buffer[0]);
1442+
value = riscv_read_debug_buffer(target, off);
14401443
} else {
14411444
uint64_t dmi_out = riscv_batch_get_dmi_read(batch, rereads);
14421445
value = get_field(dmi_out, DTM_DMI_DATA);

0 commit comments

Comments
 (0)