Discussion:
[gem5-dev] Change in gem5/gem5[master]: arch-arm: only change the pc address when GDB registers are set
Ciro Santilli (Gerrit)
2018-11-21 18:08:52 UTC
Permalink
Ciro Santilli has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/14496


Change subject: arch-arm: only change the pc address when GDB registers are
set
......................................................................

arch-arm: only change the pc address when GDB registers are set

The entire pcState was being reset, which made the simulation incorrectly
switch to aarch32 from aarch64.

Change-Id: I9ba7dd0ed95bc6120d94393bba272e0cb8c081c5
---
M src/arch/arm/remote_gdb.cc
1 file changed, 6 insertions(+), 2 deletions(-)



diff --git a/src/arch/arm/remote_gdb.cc b/src/arch/arm/remote_gdb.cc
index a395cd9..38207d4 100644
--- a/src/arch/arm/remote_gdb.cc
+++ b/src/arch/arm/remote_gdb.cc
@@ -218,7 +218,9 @@

for (int i = 0; i < 31; ++i)
context->setIntReg(INTREG_X0 + i, r.x[i]);
- context->pcState(r.pc);
+ auto pc_state = context->pcState();
+ pc_state.set(r.pc);
+ context->pcState(pc_state);
context->setMiscRegNoEffect(MISCREG_CPSR, r.cpsr);
// Update the stack pointer. This should be done after
// updating CPSR/PSTATE since that might affect how SPX gets
@@ -282,7 +284,9 @@
context->setIntReg(INTREG_R12, r.gpr[12]);
context->setIntReg(INTREG_SP, r.gpr[13]);
context->setIntReg(INTREG_LR, r.gpr[14]);
- context->pcState(r.gpr[15]);
+ auto pc_state = context->pcState();
+ pc_state.set(r.gpr[15]);
+ context->pcState(pc_state);

// One day somebody will implement transfer of FPRs correctly.
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/14496
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I9ba7dd0ed95bc6120d94393bba272e0cb8c081c5
Gerrit-Change-Number: 14496
Gerrit-PatchSet: 1
Gerrit-Owner: Ciro Santilli <***@arm.com>
Gerrit-MessageType: newchange
Loading...