summaryrefslogtreecommitdiff
path: root/src/arch/arm/remote_gdb.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm/remote_gdb.cc')
-rw-r--r--src/arch/arm/remote_gdb.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/arch/arm/remote_gdb.cc b/src/arch/arm/remote_gdb.cc
index d52a9db17..b85b45369 100644
--- a/src/arch/arm/remote_gdb.cc
+++ b/src/arch/arm/remote_gdb.cc
@@ -204,9 +204,10 @@ RemoteGDB::getregs()
memset(gdbregs.regs, 0, gdbregs.bytes());
if (inAArch64(context)) { // AArch64
- // x0-x31
- for (int i = 0; i < 32; ++i)
+ // x0-x30
+ for (int i = 0; i < 31; ++i)
gdbregs.regs64[GDB64_X0 + i] = context->readIntReg(INTREG_X0 + i);
+ gdbregs.regs64[GDB64_SPX] = context->readIntReg(INTREG_SPX);
// pc
gdbregs.regs64[GDB64_PC] = context->pcState().pc();
// cpsr
@@ -262,13 +263,17 @@ RemoteGDB::setregs()
DPRINTF(GDBAcc, "setregs in remotegdb \n");
if (inAArch64(context)) { // AArch64
- // x0-x31
- for (int i = 0; i < 32; ++i)
+ // x0-x30
+ for (int i = 0; i < 31; ++i)
context->setIntReg(INTREG_X0 + i, gdbregs.regs64[GDB64_X0 + i]);
// pc
context->pcState(gdbregs.regs64[GDB64_PC]);
// cpsr
context->setMiscRegNoEffect(MISCREG_CPSR, gdbregs.regs64[GDB64_CPSR]);
+ // Update the stack pointer. This should be done after
+ // updating CPSR/PSTATE since that might affect how SPX gets
+ // mapped.
+ context->setIntReg(INTREG_SPX, gdbregs.regs64[GDB64_SPX]);
// v0-v31
for (int i = 0; i < 128; i += 4) {
int gdboff = GDB64_V0_32 + i;