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

Method FindSubprogram

IDEHelper/DbgModule.cpp:2319–2350  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2317}
2318
2319DbgSubprogram* DbgModule::FindSubprogram(DbgType* dbgType, const char * methodName)
2320{
2321 dbgType = dbgType->GetPrimaryType();
2322 dbgType->PopulateType();
2323
2324 if (dbgType->mNeedsGlobalsPopulated)
2325 PopulateTypeGlobals(dbgType);
2326
2327 for (auto methodNameEntry : dbgType->mMethodNameList)
2328 {
2329 if ((methodNameEntry->mCompileUnitId != -1) && (strcmp(methodNameEntry->mName, methodName) == 0))
2330 {
2331 // If we hot-replaced this type then we replaced and parsed all the methods too
2332 if (!dbgType->mCompileUnit->mDbgModule->IsObjectFile())
2333 dbgType->mCompileUnit->mDbgModule->MapCompileUnitMethods(methodNameEntry->mCompileUnitId);
2334 methodNameEntry->mCompileUnitId = -1;
2335 }
2336 }
2337
2338 DbgSubprogram* result = NULL;
2339 for (auto method : dbgType->mMethodList)
2340 {
2341 if (strcmp(method->mName, methodName) == 0)
2342 {
2343 method->PopulateSubprogram();
2344 if ((result == NULL) || (method->mBlock.mLowPC != 0))
2345 result = method;
2346 }
2347 }
2348
2349 return result;
2350}
2351
2352void DbgModule::Fail(const StringImpl& error)
2353{

Callers

nothing calls this directly

Calls 5

GetPrimaryTypeMethod · 0.80
IsObjectFileMethod · 0.80
PopulateTypeMethod · 0.45
MapCompileUnitMethodsMethod · 0.45
PopulateSubprogramMethod · 0.45

Tested by

no test coverage detected