projects
/
riscv-isa-sim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3151df2
)
Add a nice debug printf for debug_module_t::store
author
Tim Newsome
<tim@sifive.com>
Mon, 28 Aug 2017 22:19:41 +0000
(15:19 -0700)
committer
Tim Newsome
<tim@sifive.com>
Mon, 28 Aug 2017 22:19:41 +0000
(15:19 -0700)
riscv/debug_module.cc
patch
|
blob
|
history
diff --git
a/riscv/debug_module.cc
b/riscv/debug_module.cc
index 17ec616ca9096f5058db46858f36bfbf090c04d3..53df8a47d1a7415f20ac8ad88d11cb74b8b29022 100644
(file)
--- a/
riscv/debug_module.cc
+++ b/
riscv/debug_module.cc
@@
-110,6
+110,19
@@
bool debug_module_t::load(reg_t addr, size_t len, uint8_t* bytes)
bool debug_module_t::store(reg_t addr, size_t len, const uint8_t* bytes)
{
bool debug_module_t::store(reg_t addr, size_t len, const uint8_t* bytes)
{
+ D(
+ switch (len) {
+ case 4:
+ fprintf(stderr, "store(addr=0x%lx, len=%d, bytes=0x%08x); "
+ "hartsel=0x%x\n", addr, (unsigned) len, *(uint32_t *) bytes,
+ dmcontrol.hartsel);
+ break;
+ default:
+ fprintf(stderr, "store(addr=0x%lx, len=%d, bytes=...); "
+ "hartsel=0x%x\n", addr, (unsigned) len, dmcontrol.hartsel);
+ break;
+ }
+ );
uint8_t id_bytes[4];
uint32_t id = 0;
uint8_t id_bytes[4];
uint32_t id = 0;
@@
-126,7
+139,6
@@
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)))) {
}
if (addr >= debug_progbuf_start && ((addr + len) <= (debug_progbuf_start + sizeof(program_buffer)))) {
- D(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;
memcpy(program_buffer + addr - debug_progbuf_start, bytes, len);
return true;