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

Method HotReplaceType

IDEHelper/DbgModule.cpp:5614–5673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5612}
5613
5614void DbgModule::HotReplaceType(DbgType* newType)
5615{
5616 auto linkedModule = GetLinkedModule();
5617
5618 newType->PopulateType();
5619 DbgType* primaryType = linkedModule->GetPrimaryType(newType);
5620 if (primaryType == newType)
5621 {
5622 // There was no previous type
5623 BF_ASSERT(primaryType->mHotNewType == NULL);
5624 return;
5625 }
5626
5627 if (primaryType->mHotNewType != newType)
5628 {
5629 // We have already pulled in the new data from a previous new type
5630 BF_ASSERT(primaryType->mHotNewType == NULL);
5631 return;
5632 }
5633 primaryType->mHotNewType = NULL;
5634
5635 HotReplaceMethods(newType, primaryType);
5636
5637 //mDebugTarget->mSymbolMap.Get()
5638
5639// bool setHotJumpFailed = false;
5640// while (!newType->mMethodList.IsEmpty())
5641// {
5642// DbgSubprogram* newMethod = newType->mMethodList.PopFront();
5643// if (!newMethod->mBlock.IsEmpty())
5644// {
5645// newMethod->PopulateSubprogram();
5646//
5647// bool found = false;
5648// for (auto oldMethod : primaryType->mHotReplacedMethodList)
5649// {
5650// if (oldMethod->mBlock.IsEmpty())
5651// continue;
5652// if (oldMethod->Equals(newMethod))
5653// {
5654// if (!setHotJumpFailed)
5655// {
5656// if (!mDebugger->SetHotJump(oldMethod, newMethod))
5657// setHotJumpFailed = true;
5658// oldMethod->mWasHotReplaced = true;
5659// }
5660// }
5661// }
5662// }
5663// newMethod->mParentType = primaryType;
5664// primaryType->mMethodList.PushBack(newMethod);
5665// }
5666
5667 primaryType->mCompileUnit->mWasHotReplaced = true;
5668
5669 primaryType->mNeedsGlobalsPopulated = newType->mNeedsGlobalsPopulated;
5670 primaryType->mUsingNamespaces = newType->mUsingNamespaces;
5671 primaryType->mMemberList = newType->mMemberList;

Callers

nothing calls this directly

Calls 2

GetPrimaryTypeMethod · 0.80
PopulateTypeMethod · 0.45

Tested by

no test coverage detected