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

@ -16,33 +16,35 @@ DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, int size)
mBlocks = new uint8*[mBlockCount];
memset(mBlocks, 0, mBlockCount * sizeof(uint8*));
mFlags = new DbgMemoryFlags[mBlockCount];
memset(mBlocks, 0, mBlockCount * sizeof(DbgMemoryFlags));
memset(mFlags, 0, mBlockCount * sizeof(DbgMemoryFlags));
mOwns = true;
}
DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, uint8* data, int size, bool makeCopy)
{
mAddr = addr;
mBlockSize = size;
mBlocks = new uint8*[1];
mFlags = new DbgMemoryFlags[1];
mSize = size;
if (makeCopy)
{
uint8* dataCopy = new uint8[size];
if (data != NULL)
memcpy(dataCopy, data, size);
mBlocks[0] = dataCopy;
}
else
{
mBlocks[0] = data;
}
mOwns = makeCopy;
mBlockCount = 1;
}
// DbgModuleMemoryCache::DbgModuleMemoryCache(uintptr addr, uint8* data, int size, bool makeCopy)
// {
// mAddr = addr;
// mBlockSize = size;
// mBlocks = new uint8*[1];
// mFlags = new DbgMemoryFlags[1];
// mSize = size;
//
// if (makeCopy)
// {
// uint8* dataCopy = new uint8[size];
// if (data != NULL)
// memcpy(dataCopy, data, size);
// else
// memset(dataCopy, 0, size);
// mBlocks[0] = dataCopy;
// }
// else
// {
// mBlocks[0] = data;
// }
//
// mOwns = makeCopy;
// mBlockCount = 1;
// }
DbgModuleMemoryCache::~DbgModuleMemoryCache()
{
@ -57,13 +59,17 @@ DbgModuleMemoryCache::~DbgModuleMemoryCache()
DbgMemoryFlags DbgModuleMemoryCache::Read(uintptr addr, uint8* data, int size)
{
BF_ASSERT(mAddr != 0);
int sizeLeft = size;
DbgMemoryFlags flags = DbgMemoryFlags_None;
if ((addr < mAddr) || (addr > mAddr + mSize))
{
gDebugger->ReadMemory(addr, size, data);
return gDebugger->GetMemoryFlags(addr);
flags = gDebugger->GetMemoryFlags(addr);
BfLogDbg("Got memory flags %p = %d\n", addr, flags);
return flags;
}
int relAddr = (int)(addr - mAddr);
@ -80,7 +86,7 @@ DbgMemoryFlags DbgModuleMemoryCache::Read(uintptr addr, uint8* data, int size)
mBlocks[blockIdx] = block;
mFlags[blockIdx] = gDebugger->GetMemoryFlags(mAddr + blockIdx * mBlockSize);
//BfLogDbg("Memory flags for %p = %d\n", mAddr + blockIdx * mBlockSize, mFlags[blockIdx]);
BfLogDbg("Memory flags for %p = %d\n", mAddr + blockIdx * mBlockSize, mFlags[blockIdx]);
}
flags = mFlags[blockIdx];