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

Method DbgGenerateModuleInfo

IDEHelper/Backend/BeCOFFObject.cpp:1357–1822  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1355}
1356
1357void BeCOFFObject::DbgGenerateModuleInfo()
1358{
1359 BP_ZONE("BeCOFFObject::DbgGenerateModuleInfo");
1360 AutoPerf perf("BeCOFFObject::DbgGenerateModuleInfo", mPerfManager);
1361
1362 auto& outS = mDebugSSect.mData;
1363 outS.Write((int)CV_SIGNATURE_C13);
1364
1365 Array<int> fileDataPositions;
1366 Array<BeDbgFunction*> inlinees;
1367
1368 // Funcs
1369 for (auto dbgFunc : mBeModule->mDbgModule->mFuncs)
1370 {
1371 if (dbgFunc->mValue == NULL)
1372 continue;
1373
1374 if (dbgFunc->mCvFuncId == -1)
1375 continue;
1376
1377 BF_ASSERT(dbgFunc->mCvFuncId != -1);
1378
1379 auto funcSym = GetSymbol(dbgFunc->mValue, false);
1380 if (funcSym == NULL)
1381 continue;
1382
1383 DbgStartSection(DEBUG_S_SYMBOLS);
1384
1385 DbgSStartTag();
1386 if (dbgFunc->mValue->mLinkageType == BfIRLinkageType_Internal)
1387 outS.Write((int16)S_LPROC32_ID);
1388 else
1389 outS.Write((int16)S_GPROC32_ID);
1390 outS.Write((int32)0); // PtrParent
1391 outS.Write((int32)0); // PtrEnd
1392 outS.Write((int32)0); // PtrNext
1393 outS.Write((int32)BF_MAX(dbgFunc->mCodeLen, 0)); // CodeSize
1394 outS.Write((int32)0); // DbgStart
1395 outS.Write((int32)0); // DbgEnd
1396 outS.Write(dbgFunc->mCvFuncId);
1397
1398 BeMCRelocation reloc;
1399 reloc.mKind = BeMCRelocationKind_SECREL;
1400 reloc.mOffset = outS.GetPos();
1401 reloc.mSymTableIdx = funcSym->mIdx;
1402 mDebugSSect.mRelocs.push_back(reloc);
1403 outS.Write((int32)0); // off
1404
1405 reloc.mKind = BeMCRelocationKind_SECTION;
1406 reloc.mOffset = outS.GetPos();
1407 reloc.mSymTableIdx = funcSym->mIdx;
1408 mDebugSSect.mRelocs.push_back(reloc);
1409 outS.Write((int16)0); // seg
1410
1411 CV_PROCFLAGS procFlags = { 0 };
1412 outS.Write(*(uint8*)&procFlags);
1413
1414 String fullName;

Callers

nothing calls this directly

Calls 15

GetInlineMatchDepthMethod · 0.80
GetInlinedAtMethod · 0.80
GetDbgFuncMethod · 0.80
TryGetValueMethod · 0.80
GetDbgFileMethod · 0.80
ToStringFunction · 0.50
WriteMethod · 0.45
GetPosMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
GetInlineDepthMethod · 0.45

Tested by

no test coverage detected