summaryrefslogtreecommitdiff
path: root/src/arch/alpha/remote_gdb.cc
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2014-12-05 01:44:24 -0800
committerGabe Black <gabeblack@google.com>2014-12-05 01:44:24 -0800
commitfe48c0a32bf749358eeb95e748f9fc2247cc5480 (patch)
tree25e64817703c264bf09fa884db7eb187927870f7 /src/arch/alpha/remote_gdb.cc
parent7540656fc5b8ce0cafb54f41b913a7e81cbfb4b3 (diff)
downloadgem5-fe48c0a32bf749358eeb95e748f9fc2247cc5480.tar.xz
misc: Make the GDB register cache accessible in various sized chunks.
Not all ISAs have 64 bit sized registers, so it's not always very convenient to access the GDB register cache in 64 bit sized chunks. This change makes it accessible in 8, 16, 32, or 64 bit chunks. The MIPS and ARM implementations were working around that limitation by bundling and unbundling 32 bit values into 64 bit values. That code has been removed.
Diffstat (limited to 'src/arch/alpha/remote_gdb.cc')
-rw-r--r--src/arch/alpha/remote_gdb.cc32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/arch/alpha/remote_gdb.cc b/src/arch/alpha/remote_gdb.cc
index 21464fda4..951a20982 100644
--- a/src/arch/alpha/remote_gdb.cc
+++ b/src/arch/alpha/remote_gdb.cc
@@ -1,4 +1,5 @@
/*
+ * Copyright 2014 Google, Inc.
* Copyright (c) 2002-2005 The Regents of The University of Michigan
* All rights reserved.
*
@@ -145,7 +146,7 @@ using namespace std;
using namespace AlphaISA;
RemoteGDB::RemoteGDB(System *_system, ThreadContext *tc)
- : BaseRemoteGDB(_system, tc, KGDB_NUMREGS)
+ : BaseRemoteGDB(_system, tc, KGDB_NUMREGS * sizeof(uint64_t))
{
memset(gdbregs.regs, 0, gdbregs.bytes());
}
@@ -211,23 +212,20 @@ RemoteGDB::getregs()
{
memset(gdbregs.regs, 0, gdbregs.bytes());
- gdbregs.regs[KGDB_REG_PC] = context->pcState().pc();
+ gdbregs.regs64[KGDB_REG_PC] = context->pcState().pc();
// @todo: Currently this is very Alpha specific.
- if (PcPAL(gdbregs.regs[KGDB_REG_PC])) {
- for (int i = 0; i < NumIntArchRegs; ++i) {
- gdbregs.regs[i] = context->readIntReg(reg_redir[i]);
- }
+ if (PcPAL(gdbregs.regs64[KGDB_REG_PC])) {
+ for (int i = 0; i < NumIntArchRegs; ++i)
+ gdbregs.regs64[i] = context->readIntReg(reg_redir[i]);
} else {
- for (int i = 0; i < NumIntArchRegs; ++i) {
- gdbregs.regs[i] = context->readIntReg(i);
- }
+ for (int i = 0; i < NumIntArchRegs; ++i)
+ gdbregs.regs64[i] = context->readIntReg(i);
}
#ifdef KGDB_FP_REGS
- for (int i = 0; i < NumFloatArchRegs; ++i) {
- gdbregs.regs[i + KGDB_REG_F0] = context->readFloatRegBits(i);
- }
+ for (int i = 0; i < NumFloatArchRegs; ++i)
+ gdbregs.regs64[i + KGDB_REG_F0] = context->readFloatRegBits(i);
#endif
}
@@ -239,22 +237,22 @@ void
RemoteGDB::setregs()
{
// @todo: Currently this is very Alpha specific.
- if (PcPAL(gdbregs.regs[KGDB_REG_PC])) {
+ if (PcPAL(gdbregs.regs64[KGDB_REG_PC])) {
for (int i = 0; i < NumIntArchRegs; ++i) {
- context->setIntReg(reg_redir[i], gdbregs.regs[i]);
+ context->setIntReg(reg_redir[i], gdbregs.regs64[i]);
}
} else {
for (int i = 0; i < NumIntArchRegs; ++i) {
- context->setIntReg(i, gdbregs.regs[i]);
+ context->setIntReg(i, gdbregs.regs64[i]);
}
}
#ifdef KGDB_FP_REGS
for (int i = 0; i < NumFloatArchRegs; ++i) {
- context->setFloatRegBits(i, gdbregs.regs[i + KGDB_REG_F0]);
+ context->setFloatRegBits(i, gdbregs.regs64[i + KGDB_REG_F0]);
}
#endif
- context->pcState(gdbregs.regs[KGDB_REG_PC]);
+ context->pcState(gdbregs.regs64[KGDB_REG_PC]);
}
void