Skip to content

Commit

Permalink
gdb: avoid panic when examining the end of memory
Browse files Browse the repository at this point in the history
Avoid an overflow panic when dereferencing 0xffffffff.

Signed-off-by: Sean Cross <sean@xobs.io>
  • Loading branch information
xobs committed Oct 16, 2019
1 parent bd6635f commit 7e285b4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wishbone-tool/src/gdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,9 @@ impl GdbServer {
} else {
for offset in (0..len).step_by(4) {
values.push(cpu.read_memory(bridge, addr + offset, 4)?);
if addr + offset >= 0xfffffffc {
break;
}
}
self.gdb_send_u32(values)?
}
Expand Down

0 comments on commit 7e285b4

Please sign in to comment.