aboutsummaryrefslogtreecommitdiff
path: root/riscv/debug_module.cc
diff options
context:
space:
mode:
authorMegan Wachs <megan@sifive.com>2017-04-18 14:04:57 -0700
committerMegan Wachs <megan@sifive.com>2017-04-18 14:04:57 -0700
commit51a8a43d747c8e182dbcb63f602c6e27df30c276 (patch)
tree9e0f42f7ead457af8259e55ed50c4ef37978424e /riscv/debug_module.cc
parent4e768d4afc8e60adb306478257c9ecbba539b958 (diff)
downloadriscv-isa-sim-51a8a43d747c8e182dbcb63f602c6e27df30c276.zip
riscv-isa-sim-51a8a43d747c8e182dbcb63f602c6e27df30c276.tar.gz
riscv-isa-sim-51a8a43d747c8e182dbcb63f602c6e27df30c276.tar.bz2
debug: Able to successfully examine a single hart.
Diffstat (limited to 'riscv/debug_module.cc')
-rw-r--r--riscv/debug_module.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/riscv/debug_module.cc b/riscv/debug_module.cc
index 62671f6..533b959 100644
--- a/riscv/debug_module.cc
+++ b/riscv/debug_module.cc
@@ -126,7 +126,9 @@ bool debug_module_t::store(reg_t addr, size_t len, const uint8_t* bytes)
}
if (addr >= debug_progbuf_start && ((addr + len) <= (debug_progbuf_start + sizeof(program_buffer)))) {
+ fprintf(stderr, "Successful write to program buffer %d bytes at %x\n", (int) len, (int) addr);
memcpy(program_buffer + addr - debug_progbuf_start, bytes, len);
+
return true;
}
@@ -213,7 +215,7 @@ bool debug_module_t::dmi_read(unsigned address, uint32_t *value)
perform_abstract_command();
}
} else if (address >= DMI_PROGBUF0 && address < DMI_PROGBUF0 + progsize) {
- unsigned i = address = DMI_PROGBUF0;
+ unsigned i = address - DMI_PROGBUF0;
result = read32(program_buffer, i);
if ((abstractauto.autoexecprogbuf >> i) & 1) {
perform_abstract_command();