mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
Improved hot swap error handling
This commit is contained in:
parent
6e5b6694a1
commit
ca37d1d8af
3 changed files with 19 additions and 6 deletions
|
@ -6462,7 +6462,7 @@ bool DbgModule::ReadCOFF(DataStream* stream, DbgModuleKind moduleKind)
|
|||
|
||||
if (needHotTargetMemory != 0)
|
||||
{
|
||||
BF_ASSERT(needHotTargetMemory == mImageSize);
|
||||
BF_ASSERT(needHotTargetMemory >= mImageSize);
|
||||
}
|
||||
|
||||
//BF_ASSERT(mEndTypeIdx == (int)linkedModule->mTypes.size());
|
||||
|
|
|
@ -110,14 +110,15 @@ void DebugTarget::SetupTargetBinary()
|
|||
checkHotReserveAddr += 4 * mb;
|
||||
}
|
||||
|
||||
if (reservedPtr != 0)
|
||||
if (reservedPtr == 0)
|
||||
{
|
||||
mDebugger->Fail("Failed to reserve memory for hot swapping");
|
||||
}
|
||||
else
|
||||
{
|
||||
BF_ASSERT(mHotHeap == NULL);
|
||||
mHotHeap = new HotHeap(reservedPtr, reserveSize);
|
||||
}
|
||||
|
||||
//TODO: Throw actual error if we can't reserve HOT area
|
||||
BF_ASSERT(reservedPtr != NULL);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1061,6 +1061,18 @@ void WinDebugger::HotLoad(const Array<String>& objectFiles, int hotIdx)
|
|||
{
|
||||
AutoCrit autoCrit(mDebugManager->mCritSect);
|
||||
|
||||
if (mDebugTarget->mTargetBinary == NULL)
|
||||
{
|
||||
Fail("Hot swapping failed because the hot target binary has not yet been loaded.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDebugTarget->mHotHeap == NULL)
|
||||
{
|
||||
Fail("There is no hot heap space available for hot swapping.");
|
||||
return;
|
||||
}
|
||||
|
||||
BfLogDbg("WinDebugger::HotLoad Start %d\n", hotIdx);
|
||||
|
||||
SetAndRestoreValue<int> prevHotIdx(mActiveHotIdx, hotIdx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue