using namespace std;
using namespace SparcISA;
-RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
- : BaseRemoteGDB(_system, c)
+RemoteGDB::RemoteGDB(System *_system, ThreadContext *c, int _port)
+ : BaseRemoteGDB(_system, c, _port), regCache32(this), regCache64(this)
{}
///////////////////////////////////////////////////////////
// from va to va + len have valid page map entries. Not
// sure how this will work for other OSes or in general.
if (FullSystem) {
- if (va)
- return true;
- return false;
+ return va != 0;
} else {
- TlbEntry entry;
// Check to make sure the first byte is mapped into the processes
// address space.
- if (context->getProcessPtr()->pTable->lookup(va, entry))
- return true;
- return false;
+ return context()->getProcessPtr()->pTable->lookup(va) != nullptr;
}
}
}
-RemoteGDB::BaseGdbRegCache*
+BaseGdbRegCache*
RemoteGDB::gdbRegs()
{
- PSTATE pstate = context->readMiscReg(MISCREG_PSTATE);
- if (pstate.am)
- {DPRINTF(GDBRead, "Creating 32-bit GDB\n");
- return new SPARCGdbRegCache(this);}
- else
- {DPRINTF(GDBRead, "Creating 64-bit GDB\n");
- return new SPARC64GdbRegCache(this);}
+ PSTATE pstate = context()->readMiscReg(MISCREG_PSTATE);
+ if (pstate.am) {
+ return ®Cache32;
+ } else {
+ return ®Cache64;
+ }
}