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

Method DisassembleAt

IDEHelper/WinDebugger.cpp:12350–12714  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12348}
12349
12350String WinDebugger::DisassembleAt(intptr inAddress)
12351{
12352 BP_ZONE("WinDebugger::DisassembleAt");
12353
12354 AutoCrit autoCrit(mDebugManager->mCritSect);
12355
12356 addr_target address = (addr_target)inAddress;
12357
12358 if (mDebugTarget == NULL)
12359 return "";
12360
12361 String result;
12362 auto dwSubProgram = mDebugTarget->FindSubProgram(address);
12363 if (dwSubProgram == NULL)
12364 return DisassembleAtRaw(address);
12365 dwSubProgram = dwSubProgram->GetRootInlineParent();
12366 DbgModule* dwarf = dwSubProgram->mCompileUnit->mDbgModule;
12367
12368 int frameBaseRegister = mDebugTarget->GetFrameBaseRegister(dwSubProgram);
12369
12370 addr_target addrStart = dwSubProgram->mBlock.mLowPC;
12371 addr_target addrEnd = dwSubProgram->mBlock.mHighPC;
12372
12373 auto dwCompileUnit = dwSubProgram->mCompileUnit;
12374 {
12375 FixupLineData(dwCompileUnit);
12376 }
12377
12378 DbgSrcFile* dwSrcFile = NULL;
12379
12380 FixupLineDataForSubprogram(dwSubProgram);
12381
12382 DbgLineData* dwLineData = NULL;
12383 if (dwSubProgram->mLineInfo != NULL)
12384 dwLineData = &dwSubProgram->mLineInfo->mLines[0];
12385 int nextLineDataIdx = 1;
12386
12387 if (dwSubProgram->mIsOptimized)
12388 result += "O\n";
12389
12390 DbgSrcFile* srcFile = NULL;
12391 int firstLine = 0;
12392 int curLine = 0;
12393 if (dwLineData != NULL)
12394 {
12395 srcFile = dwSubProgram->GetLineSrcFile(*dwLineData);
12396 result += "S " + srcFile->GetLocalPath() + "\n";
12397 if (srcFile->mHashKind != DbgHashKind_None)
12398 {
12399 result += "H ";
12400 srcFile->GetHash(result);
12401 result += "\n";
12402 }
12403
12404 curLine = BF_MAX(0, dwLineData->mLine - 5);
12405 //for (; curLine <= dwLineData->mLine; curLine++)
12406 result += StrFormat("L %d %d\n", curLine, dwLineData->mLine - curLine + 1);
12407 curLine = dwLineData->mLine + 1;

Callers 1

Calls 15

FindSubProgramMethod · 0.80
GetRootInlineParentMethod · 0.80
GetFrameBaseRegisterMethod · 0.80
GetLineSrcFileMethod · 0.80
GetLineAddrMethod · 0.80
FindClosestLineMethod · 0.80
GetLineInlineeMethod · 0.80
FindSymbolAtMethod · 0.80
GetHashMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected