summaryrefslogtreecommitdiff
path: root/src/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/sparc')
-rw-r--r--src/arch/sparc/remote_gdb.cc13
-rw-r--r--src/arch/sparc/remote_gdb.hh3
2 files changed, 9 insertions, 7 deletions
diff --git a/src/arch/sparc/remote_gdb.cc b/src/arch/sparc/remote_gdb.cc
index b7ecd3b7a..3f4df0d3a 100644
--- a/src/arch/sparc/remote_gdb.cc
+++ b/src/arch/sparc/remote_gdb.cc
@@ -148,7 +148,7 @@ using namespace std;
using namespace SparcISA;
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
- : BaseRemoteGDB(_system, c)
+ : BaseRemoteGDB(_system, c), regCache32(this), regCache64(this)
{}
///////////////////////////////////////////////////////////
@@ -248,10 +248,9 @@ RemoteGDB::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);}
+ if (pstate.am) {
+ return &regCache32;
+ } else {
+ return &regCache64;
+ }
}
diff --git a/src/arch/sparc/remote_gdb.hh b/src/arch/sparc/remote_gdb.hh
index 543683ee8..653f0b113 100644
--- a/src/arch/sparc/remote_gdb.hh
+++ b/src/arch/sparc/remote_gdb.hh
@@ -94,6 +94,9 @@ class RemoteGDB : public BaseRemoteGDB
const std::string name() const { return gdb->name() + ".SPARC64GdbRegCache"; }
};
+ SPARCGdbRegCache regCache32;
+ SPARC64GdbRegCache regCache64;
+
public:
RemoteGDB(System *_system, ThreadContext *tc);
BaseGdbRegCache *gdbRegs();