bool
ArmFault::vectorCatch(ThreadContext *tc, const StaticInstPtr &inst)
{
- auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(tc);
VectorCatch* vc = sd->getVectorCatch(tc);
if (!vc->isVCMatch()) {
Fault fault = sd->testVectorCatch(tc, 0x0, this);
PCState pc_state(xc->pcState());
pc_state.debugStep(false);
xc->pcState(pc_state);
- auto *isa = static_cast<ArmISA::ISA *>(xc->tcBase()->getIsaPtr());
- bool ldx = isa->getSelfDebug()->getSstep()->getLdx();
+
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(xc->tcBase());
+
+ bool ldx = sd->getSstep()->getLdx();
+
return std::make_shared<SoftwareStepFault>(machInst, ldx,
pc_state.stepped());
new_cpsr.daif = spsr.daif;
}
- auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
- SoftwareStep * ss = (isa->getSelfDebug())->getSstep();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(tc);
+ SoftwareStep *ss = sd->getSstep();
new_cpsr.ss = ss->debugExceptionReturnSS(tc, spsr, dest, new_cpsr.width);
return new_cpsr;
static void
activateBreakpoint(ThreadContext *tc)
{
- auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(tc);
sd->activateDebug();
}
void initID64(const ArmISAParams *p);
public:
- SelfDebug * getSelfDebug()
+ SelfDebug*
+ getSelfDebug() const
{
return selfDebug;
}
+
+ static SelfDebug*
+ getSelfDebug(ThreadContext *tc)
+ {
+ auto *arm_isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
+ return arm_isa->getSelfDebug();
+ }
+
RegVal readMiscRegNoEffect(int misc_reg) const;
RegVal readMiscReg(int misc_reg);
void setMiscRegNoEffect(int misc_reg, RegVal val);
if self.flavor in ('exclusive', 'acex'):
accCode += '''
- auto *isa = static_cast<ArmISA::ISA *>(xc->tcBase()->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
- sd->getSstep()->setLdx();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(xc->tcBase());
+ sd->getSstep()->setLdx();
'''
self.codeBlobs["memacc_code"] = accCode
'''
if self.flavor in ('exclusive', 'acex'):
accCode += '''
- auto *isa = static_cast<ArmISA::ISA *>(xc->tcBase()->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
- sd->getSstep()->setLdx();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(xc->tcBase());
+ sd->getSstep()->setLdx();
'''
self.codeBlobs["memacc_code"] = accCode
accCode = accCode % buildMemSuffix(self.sign, self.size)
if self.flavor in ('exclusive', 'acex'):
accCode += '''
- auto *isa = static_cast<ArmISA::ISA *>(xc->tcBase()->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
- sd->getSstep()->setLdx();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(xc->tcBase());
+ sd->getSstep()->setLdx();
'''
self.codeBlobs["memacc_code"] = accCode
if accEpilogCode:
'''
if self.flavor in ('exp', 'acexp'):
accCode += '''
- auto *isa = static_cast<ArmISA::ISA *>(xc->tcBase()->getIsaPtr());
- SelfDebug * sd = isa->getSelfDebug();
- sd->getSstep()->setLdx();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(xc->tcBase());
+ sd->getSstep()->setLdx();
'''
self.codeBlobs["memacc_code"] = accCode
if accEpilogCode:
//Check for Debug Exceptions
if (fault == NoFault) {
- auto *isa = static_cast<ArmISA::ISA *>(tc->getIsaPtr());
- SelfDebug *sd = isa->getSelfDebug();
+ SelfDebug *sd = ArmISA::ISA::getSelfDebug(tc);
fault = sd->testDebug(tc, req, mode);
}