MCPcopy Create free account
hub / github.com/beefytech/Beef / RollBackStackFrame_DwFrameDescriptor

Method RollBackStackFrame_DwFrameDescriptor

IDEHelper/DebugTarget.cpp:1586–1820  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1584}
1585
1586bool DebugTarget::RollBackStackFrame_DwFrameDescriptor(CPURegisters* registers, addr_target* outReturnAddressLoc)
1587{
1588 addr_target pcAddress = (addr_target)registers->GetPC();
1589
1590 //TODO: Verify we replaced this correctly
1591 /*auto stackFrameItr = mFrameDescriptorMap.upper_bound(pcAddress);
1592 if (stackFrameItr != mFrameDescriptorMap.end())
1593 stackFrameItr--;
1594 if (stackFrameItr == mFrameDescriptorMap.end())
1595 return false;*/
1596
1597 if (mDwFrameDescriptorMap.empty())
1598 return false;
1599 auto stackFrameItr = mDwFrameDescriptorMap.upper_bound(pcAddress);
1600 if (stackFrameItr == mDwFrameDescriptorMap.begin())
1601 return false;
1602 stackFrameItr--;
1603
1604 auto dwFrameDescriptor = &stackFrameItr->second;
1605 if (pcAddress > dwFrameDescriptor->mHighPC)
1606 return false;
1607
1608 struct RegisterRuleData
1609 {
1610 public:
1611 int mRegisterRule;
1612 int mParamOffset;
1613 const uint8* mParamData;
1614
1615 public:
1616 RegisterRuleData()
1617 {
1618 mRegisterRule = DW_CFA_undefined;
1619 mParamOffset = 0;
1620 mParamData = NULL;
1621 }
1622 };
1623
1624 struct State
1625 {
1626 State* mPrevState;
1627 RegisterRuleData mRegisterRuleDataArray[CPURegisters::kNumIntRegs];
1628 int mRegisterRuleDataIdx;
1629 addr_target mCFA = 0;
1630 int mCFAOffset = 0;
1631
1632 State()
1633 {
1634 mPrevState = NULL;
1635 mCFA = 0;
1636 mCFAOffset = 0;
1637 mRegisterRuleDataIdx = -1;
1638 }
1639 };
1640
1641 State initialState;
1642 State rootState;
1643 rootState.mRegisterRuleDataIdx = DwarfReg_SP;

Callers

nothing calls this directly

Calls 6

DecodeULEB128Function · 0.85
ExecuteOpsMethod · 0.80
GetPCMethod · 0.45
emptyMethod · 0.45
beginMethod · 0.45
ReadMemoryMethod · 0.45

Tested by

no test coverage detected