1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-08 03:28:20 +02:00

Win32 debugging fixes, more work on custom compile commands

Fixed working dir for 'launch'
Fixed attaching to process - stack trace wasn't updating properly
Fixed more custom compile stuff, and BeefySysLib bin destination
Fixed linking issues related to Bfp* and Bp* exports in both BeefRT and BeefySysLib
Fixed a crash with conditional breakpoints
Fixed release mode IDE issues (related to hot swap breakpoints)
Fixed hotswapping type data with LLVM builds
Fixed 'Pause' state processing Running_ToTempBreakpoint for ScriptManager
Fixed Win32 step out when there's an ESP adjustment at the return site
Made step-out skip over "unimportant" instructions at return site
This commit is contained in:
Brian Fiete 2019-08-29 14:19:07 -07:00
parent 09016c8dc0
commit a367b8165f
60 changed files with 1131 additions and 1065 deletions

View file

@ -4877,11 +4877,23 @@ void DbgModule::CommitHotTargetSections()
addr_target hotAddr = GetHotTargetAddress(hotTargetSection);
if (hotAddr != 0)
{
void* imageDestPtr = mOrigImageData->mBlocks[0] + hotTargetSection->mImageOffset;
if (hotTargetSection->mData != NULL)
memcpy(imageDestPtr, hotTargetSection->mData, hotTargetSection->mDataSize);
else
// void* imageDestPtr = mOrigImageData->mBlocks[0] + hotTargetSection->mImageOffset;
// if (hotTargetSection->mData != NULL)
// memcpy(imageDestPtr, hotTargetSection->mData, hotTargetSection->mDataSize);
// else
// memset(imageDestPtr, 0, hotTargetSection->mDataSize);
BF_ASSERT(mOrigImageData->mAddr != 0);
void* imageDestPtr = hotTargetSection->mData;
bool isTemp = false;
if (imageDestPtr == NULL)
{
imageDestPtr = new uint8[hotTargetSection->mDataSize];
memset(imageDestPtr, 0, hotTargetSection->mDataSize);
isTemp = true;
}
if (hotTargetSection->mCanExecute)
{
bool success = mDebugger->WriteInstructions(hotAddr, imageDestPtr, hotTargetSection->mDataSize);
@ -4892,6 +4904,9 @@ void DbgModule::CommitHotTargetSections()
bool success = mDebugger->WriteMemory(hotAddr, imageDestPtr, hotTargetSection->mDataSize);
BF_ASSERT(success);
}
if (isTemp)
delete imageDestPtr;
}
}
}
@ -5664,7 +5679,8 @@ bool DbgModule::ReadCOFF(DataStream* stream, bool isHotObjectFile)
mDebugger->ReserveHotTargetMemory(needHotTargetMemory);
// '0' address is temporary
mOrigImageData = new DbgModuleMemoryCache(0, NULL, needHotTargetMemory, true);
//mOrigImageData = new DbgModuleMemoryCache(0, NULL, needHotTargetMemory, true);
mOrigImageData = new DbgModuleMemoryCache(0, needHotTargetMemory);
}
int numSections = ntHdr.mFileHeader.mNumberOfSections;