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

Method Scan

IDEHelper/HotScanner.cpp:348–436  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void DbgHotScanner::Scan(DbgHotResolveFlags flags)
349{
350 auto prevRunState = mDebugger->mRunState;
351 if ((mDebugger->mRunState == RunState_Running) && ((flags & DbgHotResolveFlag_KeepThreadState) == 0))
352 {
353 mDebugger->ThreadRestorePause(NULL, NULL);
354 mDebugger->mRunState = RunState_Paused;
355 }
356
357 if ((flags & DbgHotResolveFlag_ActiveMethods) != 0)
358 PopulateHotCallstacks();
359
360 if ((flags & DbgHotResolveFlag_Allocations) != 0)
361 {
362 addr_target gcDbgDataAddr = 0;
363
364 for (auto module : mDebugger->mDebugTarget->mDbgModules)
365 {
366 if ((module->mFilePath.Contains("Beef")) && (module->mFilePath.Contains("Dbg")))
367 {
368 module->ParseTypeData();
369 module->ParseSymbolData();
370 auto entry = module->mSymbolNameMap.Find("gGCDbgData");
371 if ((entry != NULL) && (entry->mValue != NULL))
372 gcDbgDataAddr = entry->mValue->mAddress;
373 }
374 }
375
376 auto module = mDebugger->mDebugTarget->mTargetBinary;
377 if (module->mBfTypesInfoAddr == 0)
378 {
379 module->mBfTypesInfoAddr = -1;
380 auto typeTypeEntry = module->FindType("System.Type", DbgLanguage_Beef);
381 if ((typeTypeEntry != NULL) && (typeTypeEntry->mValue != NULL))
382 {
383 auto typeType = typeTypeEntry->mValue;
384 module->mBfTypeType = typeType;
385 if (typeType->mNeedsGlobalsPopulated)
386 typeType->mCompileUnit->mDbgModule->PopulateTypeGlobals(typeType);
387
388 for (auto member : typeType->mMemberList)
389 {
390 if ((member->mIsStatic) && (member->mName != NULL) && (strcmp(member->mName, "sTypes") == 0) && (member->mLocationData != NULL))
391 {
392 DbgAddrType addrType;
393 module->mBfTypesInfoAddr = member->mCompileUnit->mDbgModule->EvaluateLocation(NULL, member->mLocationData, member->mLocationLen, NULL, &addrType);
394 }
395 }
396
397 if (module->mBfTypesInfoAddr <= 0)
398 {
399 auto entry = module->mSymbolNameMap.Find(
400#ifdef BF_DBG_64
401 "?sTypes@Type@System@bf@@2PEAPEAV123@A"
402#else
403 "?sTypes@Type@System@bf@@2PAPAV123@A"
404#endif
405 );

Callers 2

InitiateHotResolveMethod · 0.80
GetDbgAllocInfoMethod · 0.80

Calls 10

ThreadRestorePauseMethod · 0.80
ThreadRestoreUnpauseMethod · 0.80
ContainsMethod · 0.45
ParseTypeDataMethod · 0.45
ParseSymbolDataMethod · 0.45
FindMethod · 0.45
FindTypeMethod · 0.45
PopulateTypeGlobalsMethod · 0.45
EvaluateLocationMethod · 0.45
ReadMemoryMethod · 0.45

Tested by

no test coverage detected