From: Boris Shingarov Date: Sun, 8 Mar 2020 19:46:05 +0000 (-0400) Subject: base: Do not treat addresses < 10 specially X-Git-Tag: v20.0.0.0~315 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bdfbd9b9bcb0f963527fc96b18816fa834ef07f6;p=gem5.git base: Do not treat addresses < 10 specially The RSP stub (base/remote_gdb.cc) treats virtual addresses below 0x000A as meaning "the address used in the previous m-packet". This leads to nasty surprises, and is not justified by neither the RSP protocol documentation nor other existing RSP implementations. Jira Issue: https://gem5.atlassian.net/browse/GEM5-407 Change-Id: I5fccc10a58d9af856eeee6d45418905c0f47ffab Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/26605 Maintainer: Gabe Black Tested-by: kokoro Reviewed-by: Gabe Black --- diff --git a/src/base/remote_gdb.cc b/src/base/remote_gdb.cc index add903e78..ada5e27d6 100644 --- a/src/base/remote_gdb.cc +++ b/src/base/remote_gdb.cc @@ -604,14 +604,6 @@ BaseRemoteGDB::send(const char *bp) bool BaseRemoteGDB::read(Addr vaddr, size_t size, char *data) { - static Addr lastaddr = 0; - static size_t lastsize = 0; - - if (vaddr < 10) { - DPRINTF(GDBRead, "read: reading memory location zero!\n"); - vaddr = lastaddr + lastsize; - } - DPRINTF(GDBRead, "read: addr=%#x, size=%d", vaddr, size); PortProxy &proxy = tc->getVirtProxy(); @@ -635,14 +627,6 @@ BaseRemoteGDB::read(Addr vaddr, size_t size, char *data) bool BaseRemoteGDB::write(Addr vaddr, size_t size, const char *data) { - static Addr lastaddr = 0; - static size_t lastsize = 0; - - if (vaddr < 10) { - DPRINTF(GDBWrite, "write: writing memory location zero!\n"); - vaddr = lastaddr + lastsize; - } - if (DTRACE(GDBWrite)) { DPRINTFN("write: addr=%#x, size=%d", vaddr, size); if (DTRACE(GDBExtra)) {