Addr pc = vaddr;
if (pcst.itstate() != 0x0)
pc = pcst.pc();
- if (p.getEnable() && p.isActive(pc) &&(!to32 || !p.isSet())){
+ if (p.enable && p.isActive(pc) &&(!to32 || !p.onUse)) {
const DBGBCR ctr = p.getControlReg(tc);
if (p.isEnabled(tc, el, ctr.hmc, ctr.ssc, ctr.pmc)) {
bool debug = p.test(tc, pc, el, ctr, false);
if (debug){
if (to32)
- p.setOnUse();
+ p.onUse = true;
return triggerException(tc, pc);
}
}
Fault
SelfDebug::triggerException(ThreadContext * tc, Addr vaddr)
{
- if (isTo32()) {
+ if (to32) {
return std::make_shared<PrefetchAbort>(vaddr,
ArmFault::DebugEvent, false,
ArmFault::UnknownTran,
int idxtmp = -1;
for (auto &p: arWatchPoints){
idxtmp ++;
- if (p.getEnable())
- {
+ if (p.enable) {
bool debug = p.test(tc, vaddr, el, write, atomic, size);
if (debug){
return triggerWatchpointException(tc, vaddr, write, cm);
SelfDebug::triggerWatchpointException(ThreadContext *tc, Addr vaddr,
bool write, bool cm)
{
- if (isTo32()) {
+ if (to32) {
ArmFault::DebugType d = cm? ArmFault::WPOINT_CM:
ArmFault::WPOINT_NOCM;
return std::make_shared<DataAbort>(vaddr,
{
bool debug = false;
const DBGBCR ctr = getControlReg(tc);
- if ((ctr.bt & 0x1) && getEnable()){
+ if ((ctr.bt & 0x1) && enable) {
debug = test(tc, vaddr, el, ctr, true);
}
return debug;
uint8_t mask, unsigned size)
{
Addr addr_tocmp = getAddrfromReg(tc);
- int maxAddrSize = getMaxAddrSize();
int maxbits = isDoubleAligned(addr_tocmp) ? 4: 8;
int bottom = isDoubleAligned(addr_tocmp) ? 2: 3;
Addr addr = bits(in_addr, maxAddrSize, 0);
bool onUse;
public:
+ friend class SelfDebug;
+
BrkPoint(MiscRegIndex _ctrlIndex, MiscRegIndex _valIndex,
MiscRegIndex _xIndex, SelfDebug* _conf, bool _ctxAw, bool lva,
bool vmid16, bool aarch32):
{
maxAddrSize = lva ? 52: 48 ;
maxAddrSize = aarch32 ? 31 : maxAddrSize;
- onUse=false;
- }
- void setOnUse()
- {
- onUse = true;
- }
- void unsetOnUse()
- {
onUse = false;
}
- bool isSet()
- {
- return onUse;
- }
+
bool testLinkedBk(ThreadContext *tc, Addr vaddr, ExceptionLevel el);
bool test(ThreadContext *tc, Addr pc, ExceptionLevel el, DBGBCR ctr,
bool from_link);
{
enable = val.e == 0x1;
}
- bool getEnable()
- {
- return enable;
- }
-
};
class WatchPoint
bool enable;
int maxAddrSize;
- inline int getMaxAddrSize()
- {
- return maxAddrSize;
- }
-
-
public:
+ friend class SelfDebug;
+
WatchPoint(MiscRegIndex _ctrlIndex, MiscRegIndex _valIndex,
SelfDebug* _conf, bool lva, bool aarch32):
ctrlRegIndex(_ctrlIndex),
{
enable = val.e == 0x1;
}
- bool getEnable()
- {
- return enable;
- }
bool isEnabled(ThreadContext* tc, ExceptionLevel el, bool hmc,
uint8_t ssc, uint8_t pac);
void activateDebug()
{
for (auto &p: arBrkPoints){
- p.unsetOnUse();
+ p.onUse = false;
}
}
return aarch32;
}
- inline bool isTo32()
- {
- return to32;
- }
inline void setAArch32(ThreadContext * tc)
{
ExceptionLevel fromEL = (ExceptionLevel) currEL(tc);
aarch32 = ELIs32(tc, fromEL);
return;
}
+
SoftwareStep * getSstep()
{
return softStep;