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

Method ScanCompileUnit

IDEHelper/COFF.cpp:4669–4732  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4667}
4668
4669void COFF::ScanCompileUnit(int compileUnitId)
4670{
4671 BP_ZONE("COFF::ScanCompileUnit");
4672
4673 CvModuleInfo* moduleInfo = mCvModuleInfo[compileUnitId];
4674
4675 if (moduleInfo->mStream < 0)
4676 return;
4677
4678 BF_ASSERT(moduleInfo->mSymbolBytes % 4 == 0);
4679 uint8* sectionData = CvReadStreamSegment(moduleInfo->mStream, moduleInfo->mSymbolBytes, moduleInfo->mLinesBytes);
4680 uint8* data = sectionData;
4681 uint8* dataEnd = sectionData + moduleInfo->mLinesBytes;
4682
4683 while (data < dataEnd)
4684 {
4685 GET_INTO(int32, lineInfoType);
4686 GET_INTO(int32, lineInfoLength);
4687 uint8* dataEnd = data + lineInfoLength;
4688
4689 if (lineInfoType == DEBUG_S_FILECHKSMS)
4690 {
4691 while (data < dataEnd)
4692 {
4693 GET_INTO(uint, fileTableOfs);
4694
4695 DbgSrcFile* srcFile;
4696
4697 DbgSrcFile** srcFilePtr = NULL;
4698 if (!mCVSrcFileRefCache.TryAdd(fileTableOfs, NULL, &srcFilePtr))
4699 {
4700 srcFile = *srcFilePtr;
4701 }
4702 else
4703 {
4704 const char* fileName = mStringTable.mStrTable + fileTableOfs;
4705 FixEmitFileName(fileName);
4706 srcFile = AddSrcFile(NULL, fileName);
4707 mSrcFileDeferredRefs.Add(srcFile);
4708 *srcFilePtr = srcFile;
4709 //mCVSrcFileRefCache[fileTableOfs] = srcFile;
4710 }
4711
4712 DbgDeferredSrcFileReference dbgDeferredSrcFileReference;
4713 dbgDeferredSrcFileReference.mDbgModule = this;
4714 dbgDeferredSrcFileReference.mCompileUnitId = compileUnitId;
4715 srcFile->mDeferredRefs.push_back(dbgDeferredSrcFileReference);
4716 srcFile->mHadLineData = true;
4717
4718 GET_INTO(uint8, hashLen);
4719 GET_INTO(uint8, hashType);
4720 data += hashLen;
4721
4722 PTR_ALIGN(data, sectionData, 4);
4723 }
4724
4725 break; // Stop once we handle the file checksums
4726 }

Callers

nothing calls this directly

Calls 4

FixEmitFileNameFunction · 0.85
TryAddMethod · 0.45
AddMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected