summaryrefslogtreecommitdiff
path: root/src/arch/sparc/remote_gdb.cc
diff options
context:
space:
mode:
authorAli Saidi <saidi@eecs.umich.edu>2007-02-15 15:24:08 -0500
committerAli Saidi <saidi@eecs.umich.edu>2007-02-15 15:24:08 -0500
commite8cd54e805e9db51d184bb07b104a7e807926cec (patch)
tree8f4a8fa5b9c219ad17d8d7b65f6e12a137e94fbb /src/arch/sparc/remote_gdb.cc
parente3dcbc94f77302b23365d191d43d60b1425c76b1 (diff)
downloadgem5-e8cd54e805e9db51d184bb07b104a7e807926cec.tar.xz
fixup remote gdb support for sparc fs
--HG-- extra : convert_revision : 5edf0ad492fe438d66bcf0ae469ef841cd71e157
Diffstat (limited to 'src/arch/sparc/remote_gdb.cc')
-rw-r--r--src/arch/sparc/remote_gdb.cc32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/arch/sparc/remote_gdb.cc b/src/arch/sparc/remote_gdb.cc
index 21c4a468c..2221576a3 100644
--- a/src/arch/sparc/remote_gdb.cc
+++ b/src/arch/sparc/remote_gdb.cc
@@ -138,7 +138,7 @@ using namespace std;
using namespace TheISA;
RemoteGDB::RemoteGDB(System *_system, ThreadContext *c)
- : BaseRemoteGDB(_system, c, NumGDBRegs)
+ : BaseRemoteGDB(_system, c, NumGDBRegs), nextBkpt(0)
{}
///////////////////////////////////////////////////////////
@@ -165,10 +165,27 @@ RemoteGDB::getregs()
{
memset(gdbregs.regs, 0, gdbregs.size);
- gdbregs.regs[RegPc] = context->readPC();
- gdbregs.regs[RegNpc] = context->readNextPC();
+ if (context->readMiscRegWithEffect(MISCREG_PSTATE) &
+ PSTATE::am)
+ panic("In 32bit mode\n");
+
+ gdbregs.regs[RegPc] = htobe(context->readPC());
+ gdbregs.regs[RegNpc] = htobe(context->readNextPC());
for(int x = RegG0; x <= RegI0 + 7; x++)
- gdbregs.regs[x] = context->readIntReg(x - RegG0);
+ gdbregs.regs[x] = htobe(context->readIntReg(x - RegG0));
+
+ gdbregs.regs[RegFsr] = htobe(context->readMiscRegWithEffect(MISCREG_FSR));
+ gdbregs.regs[RegFprs] = htobe(context->readMiscRegWithEffect(MISCREG_FPRS));
+ gdbregs.regs[RegY] = htobe(context->readIntReg(NumIntArchRegs + 1));
+ gdbregs.regs[RegState] = htobe(
+ context->readMiscRegWithEffect(MISCREG_CWP) |
+ context->readMiscRegWithEffect(MISCREG_PSTATE) << 8 |
+ context->readMiscRegWithEffect(MISCREG_ASI) << 24 |
+ context->readIntReg(NumIntArchRegs + 2) << 32);
+
+
+ DPRINTF(GDBRead, "PC=%#x\n", gdbregs.regs[RegPc]);
+
//Floating point registers are left at 0 in netbsd
//All registers other than the pc, npc and int regs
//are ignored as well.
@@ -193,12 +210,13 @@ RemoteGDB::setregs()
void
RemoteGDB::clearSingleStep()
{
- warn("SPARC single stepping not implemented, "
- "but clearSingleStep called\n");
+ if (nextBkpt)
+ clearTempBreakpoint(nextBkpt);
}
void
RemoteGDB::setSingleStep()
{
- panic("SPARC single stepping not implemented.\n");
+ nextBkpt = context->readNextPC();
+ setTempBreakpoint(nextBkpt);
}