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

Method ParseDWARF

IDEHelper/DbgModule.cpp:3182–4532  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3180}
3181
3182bool DbgModule::ParseDWARF(const uint8*& dataPtr)
3183{
3184 BP_ZONE("ParseDWARF");
3185
3186 const uint8* data = dataPtr;
3187 const uint8* startData = mDebugInfoData;
3188 int dataOfs = (int)(data - mDebugInfoData);
3189
3190 intptr_target length = GET(int);
3191
3192 DbgModule* linkedModule = GetLinkedModule();
3193
3194 if (length == -1)
3195 {
3196 mIsDwarf64 = true;
3197 length = (intptr_target)GET(int64);
3198 }
3199 else
3200 mIsDwarf64 = false;
3201
3202 if (length == 0)
3203 return false;
3204 const uint8* dataEnd = data + length;
3205 int version = GET(short);
3206 int abbrevOffset = GET(int);
3207 char pointerSize = GET(char);
3208
3209 ParseAbbrevData(mDebugAbbrevData + abbrevOffset);
3210
3211 DbgCompileUnit* compileUnit = new DbgCompileUnit(this);
3212 mDbgFlavor = DbgFlavor_GNU;
3213 compileUnit->mDbgModule = this;
3214 mCompileUnits.push_back(compileUnit);
3215
3216 DbgSubprogram* subProgram = NULL;
3217
3218 //std::map<int, DbgType*> typeMap;
3219 //std::map<int, DbgSubprogram*> subprogramMap;
3220 int tagStart = (int)(data - startData);
3221 int tagEnd = (int)(dataEnd - startData);
3222 DbgDataMap dataMap(tagStart, tagEnd);
3223 DataStack dataStack;
3224 Array<AbstractOriginEntry> abstractOriginReplaceList;
3225
3226 Array<int> deferredArrayDims;
3227
3228 int startingTypeIdx = (int)linkedModule->mTypes.size();
3229
3230 while (data < dataEnd)
3231 {
3232 gAbbrevNum++;
3233
3234 const uint8* tagDataStart = data;
3235 int tagIdx = (int)(tagDataStart - startData);
3236
3237 int abbrevIdx = (int)DecodeULEB128(data);
3238 const uint8* abbrevData = mDebugAbbrevPtrData[abbrevIdx];
3239

Callers

nothing calls this directly

Calls 15

DecodeULEB128Function · 0.85
MakeDataPairFunction · 0.85
DecodeSLEB128Function · 0.85
StringClass · 0.85
GetRootInlineParentMethod · 0.80
findMethod · 0.80
IsNamespaceMethod · 0.80
MapTypesMethod · 0.80
push_backMethod · 0.45
sizeMethod · 0.45
ClearMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected