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

Method FindLineCallAddresses

IDEHelper/WinDebugger.cpp:12716–12928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12714}
12715
12716String WinDebugger::FindLineCallAddresses(intptr inAddress)
12717{
12718 String callAddresses;
12719
12720 addr_target address = (addr_target)inAddress;
12721
12722 DbgSubprogram* dwSubprogram = NULL;
12723
12724 DbgLineData* startLineData = FindLineDataAtAddress(address, &dwSubprogram, NULL);
12725
12726 if (dwSubprogram == NULL)
12727 return "";
12728
12729 CPURegisters registers;
12730 PopulateRegisters(&registers);
12731
12732 auto inlinerSubprogram = dwSubprogram->GetRootInlineParent();
12733 FixupLineDataForSubprogram(inlinerSubprogram);
12734
12735 if (inlinerSubprogram->mLineInfo->mLines.mSize == 0)
12736 return "";
12737 auto lineData = &inlinerSubprogram->mLineInfo->mLines[0];
12738
12739 addr_target addr = dwSubprogram->mBlock.mLowPC;
12740 addr_target endAddr = dwSubprogram->mBlock.mHighPC;
12741
12742 DbgSubprogram* checkSubprogram = dwSubprogram;
12743 DbgLineData* checkLineData = lineData;
12744 addr_target checkLineAddr = 0;
12745
12746 int lineIdx = 0;
12747 while (checkLineData != NULL)
12748 {
12749 //auto nextLineData = dwSubprogram->mCompileUnit->mLineDataMap.GetNext(checkLineData);
12750 ++lineIdx;
12751
12752 DbgLineData* nextLineData = NULL;
12753 addr_target nextLineAddr;
12754 if (lineIdx < inlinerSubprogram->mLineInfo->mLines.size())
12755 {
12756 nextLineData = &inlinerSubprogram->mLineInfo->mLines[lineIdx];
12757 nextLineAddr = dwSubprogram->GetLineAddr(*nextLineData);
12758 }
12759 else
12760 nextLineAddr = inlinerSubprogram->mBlock.mHighPC;
12761
12762 // This stuff doesn't make sense...
12763 DbgSubprogram* nextSubProgram;
12764 if (nextLineData != NULL)
12765 {
12766 if (nextLineAddr > dwSubprogram->mBlock.mHighPC)
12767 break;
12768
12769 endAddr = nextLineAddr;
12770 nextSubProgram = mDebugTarget->FindSubProgram(endAddr);
12771 if (nextSubProgram != NULL)
12772 {
12773 auto dbgModule = nextSubProgram->mCompileUnit->mDbgModule;

Calls 15

CreateFilterNameFunction · 0.85
GetRootInlineParentMethod · 0.80
GetLineAddrMethod · 0.80
FindSubProgramMethod · 0.80
DecodeInstructionMethod · 0.80
FindSymbolAtMethod · 0.80
TryGetValueMethod · 0.80
IsFilteredMethod · 0.80
FindClosestLineMethod · 0.80
sizeMethod · 0.45
ParseSymbolDataMethod · 0.45
GetPCRegisterRefMethod · 0.45

Tested by

no test coverage detected