summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorKevin Lim <ktlim@umich.edu>2006-03-04 13:06:24 -0500
committerKevin Lim <ktlim@umich.edu>2006-03-04 13:06:24 -0500
commit5790e295a93e9aecd17696fc35106dccff094cfb (patch)
tree4cecab1454e4ac75e18ae9c467fd3e8ad8fa4ec1 /base
parent1e071c9f5fd5258ff92dc496aecc175db94a5ad7 (diff)
parentfc664f7ca6d4883e9efe7fb823cd903a867af7a9 (diff)
downloadgem5-5790e295a93e9aecd17696fc35106dccff094cfb.tar.xz
Merge ktlim@zizzer:/bk/m5
into zamp.eecs.umich.edu:/z/ktlim2/m5-shadowregs arch/alpha/ev5.cc: Remove intr_post, it is no longer used. arch/alpha/isa_traits.hh: Hand merge. --HG-- extra : convert_revision : 94f14539a9e5646f8c368b15b2dff18ab2f492cf
Diffstat (limited to 'base')
-rw-r--r--base/remote_gdb.cc39
1 files changed, 31 insertions, 8 deletions
diff --git a/base/remote_gdb.cc b/base/remote_gdb.cc
index f56ddf7cf..57a179719 100644
--- a/base/remote_gdb.cc
+++ b/base/remote_gdb.cc
@@ -424,12 +424,25 @@ void
RemoteGDB::getregs()
{
memset(gdbregs, 0, sizeof(gdbregs));
- memcpy(&gdbregs[KGDB_REG_V0], context->regs.intRegFile, 32 * sizeof(uint64_t));
+
+ gdbregs[KGDB_REG_PC] = context->readPC();
+
+ // @todo: Currently this is very Alpha specific.
+ if (AlphaISA::PcPAL(gdbregs[KGDB_REG_PC])) {
+ for (int i = 0; i < TheISA::NumIntArchRegs; ++i) {
+ gdbregs[i] = context->readIntReg(AlphaISA::reg_redir[i]);
+ }
+ } else {
+ for (int i = 0; i < TheISA::NumIntArchRegs; ++i) {
+ gdbregs[i] = context->readIntReg(i);
+ }
+ }
+
#ifdef KGDB_FP_REGS
- memcpy(&gdbregs[KGDB_REG_F0], context->regs.floatRegFile.q,
- 32 * sizeof(uint64_t));
+ for (int i = 0; i < TheISA::NumFloatArchRegs; ++i) {
+ gdbregs[i + KGDB_REG_F0] = context->readFloatRegInt(i);
+ }
#endif
- gdbregs[KGDB_REG_PC] = context->regs.pc;
}
///////////////////////////////////////////////////////////
@@ -441,11 +454,21 @@ RemoteGDB::getregs()
void
RemoteGDB::setregs()
{
- memcpy(context->regs.intRegFile, &gdbregs[KGDB_REG_V0],
- 32 * sizeof(uint64_t));
+ // @todo: Currently this is very Alpha specific.
+ if (AlphaISA::PcPAL(gdbregs[KGDB_REG_PC])) {
+ for (int i = 0; i < TheISA::NumIntArchRegs; ++i) {
+ context->setIntReg(AlphaISA::reg_redir[i], gdbregs[i]);
+ }
+ } else {
+ for (int i = 0; i < TheISA::NumIntArchRegs; ++i) {
+ context->setIntReg(i, gdbregs[i]);
+ }
+ }
+
#ifdef KGDB_FP_REGS
- memcpy(context->regs.floatRegFile.q, &gdbregs[KGDB_REG_F0],
- 32 * sizeof(uint64_t));
+ for (int i = 0; i < TheISA::NumFloatArchRegs; ++i) {
+ context->setFloatRegInt(i, gdbregs[i + KGDB_REG_F0]);
+ }
#endif
context->regs.pc = gdbregs[KGDB_REG_PC];
}