Skip to content

Commit

Permalink
Merge pull request #92 from riscv/FE_402_fix
Browse files Browse the repository at this point in the history
Fe 402 fix
  • Loading branch information
timsifive authored Aug 13, 2017
2 parents 96eb73c + 3109da7 commit 1af0c09
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/target/riscv/riscv-013.c
Original file line number Diff line number Diff line change
Expand Up @@ -1436,7 +1436,10 @@ static int read_memory(struct target *target, target_addr_t address,

if (this_is_last_read && i == start + reads - 1) {
riscv013_set_autoexec(target, d_data, 0);
value = riscv_program_read_ram(&program, r_data);

// access debug buffer without executing a program - this address logic was taken from program.c
int const off = (r_data - riscv_debug_buffer_addr(program.target)) / sizeof(program.debug_buffer[0]);
value = riscv_read_debug_buffer(target, off);
} else {
uint64_t dmi_out = riscv_batch_get_dmi_read(batch, rereads);
value = get_field(dmi_out, DTM_DMI_DATA);
Expand Down

0 comments on commit 1af0c09

Please sign in to comment.