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

Method Callstack_GetStackFrameOldFileInfo

IDEHelper/WinDebugger.cpp:11979–12030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11977}
11978
11979String WinDebugger::Callstack_GetStackFrameOldFileInfo(int stackFrameIdx)
11980{
11981 AutoCrit autoCrit(mDebugManager->mCritSect);
11982
11983 if (!FixCallStackIdx(stackFrameIdx))
11984 return "";
11985
11986 int actualStackFrameIdx = BF_MAX(0, stackFrameIdx);
11987 UpdateCallStackMethod(actualStackFrameIdx);
11988 WdStackFrame* wdStackFrame = mCallStack[actualStackFrameIdx];
11989
11990 DbgModule* dbgModule = NULL;
11991 DbgSrcFile* dbgSrcFile = NULL;
11992
11993 if (wdStackFrame->mInInlineMethod)
11994 {
11995 WdStackFrame* nextStackFrame = mCallStack[actualStackFrameIdx - 1];
11996 auto subProgram = nextStackFrame->mSubProgram;
11997 dbgModule = subProgram->mCompileUnit->mDbgModule;
11998
11999 FixupLineDataForSubprogram(subProgram->mInlineeInfo->mRootInliner);
12000 DbgSubprogram* parentSubprogram = subProgram->mInlineeInfo->mInlineParent; // Require it be in the inline parent
12001 auto foundLine = parentSubprogram->FindClosestLine(subProgram->mBlock.mLowPC, &parentSubprogram);
12002 if (foundLine != NULL)
12003 dbgSrcFile = parentSubprogram->GetLineSrcFile(*foundLine);
12004
12005 DbgSubprogram* callingSubProgram = NULL;
12006 DbgLineData* callingLineData = FindLineDataAtAddress(nextStackFrame->mSubProgram->mBlock.mLowPC - 1, &callingSubProgram);
12007 if ((callingLineData != NULL) && (callingSubProgram == wdStackFrame->mSubProgram))
12008 dbgSrcFile = callingSubProgram->GetLineSrcFile(*callingLineData);
12009 }
12010 else
12011 {
12012 DbgSubprogram* dwSubprogram = wdStackFrame->mSubProgram;
12013 if (dwSubprogram != NULL)
12014 {
12015 FixupLineDataForSubprogram(dwSubprogram);
12016 addr_target findAddress = wdStackFrame->GetSourcePC();
12017
12018 DbgSubprogram* dbgSubprogram = NULL;
12019 DbgLineData* dwLineData = dwSubprogram->FindClosestLine(findAddress, &dbgSubprogram, &dbgSrcFile);
12020 dbgModule = dwSubprogram->mCompileUnit->mDbgModule;
12021 }
12022 }
12023
12024 if (dbgSrcFile != NULL)
12025 {
12026 // Note: we must use mFilePath here, make sure we don't use GetLocalPath()
12027 return dbgModule->GetOldSourceCommand(dbgSrcFile->mFilePath);
12028 }
12029 return "";
12030}
12031
12032int WinDebugger::GetJmpState(int stackFrameIdx)
12033{

Calls 4

FindClosestLineMethod · 0.80
GetLineSrcFileMethod · 0.80
GetSourcePCMethod · 0.80
GetOldSourceCommandMethod · 0.45

Tested by

no test coverage detected