1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 20:12:21 +02:00

Changes to improve IDE Module Panel, allowing loading image and pdb

This commit is contained in:
Brian Fiete 2019-09-27 13:05:39 -07:00
parent d41a8c5683
commit bac46ef6e9
10 changed files with 124 additions and 41 deletions

View file

@ -223,7 +223,9 @@ uint8* CvStreamReader::GetPermanentPtr(int offset, int size, bool* madeCopy)
COFF::COFF(DebugTarget* debugTarget) : DbgModule(debugTarget)
{
mParseKind = ParseKind_Full;
memset(mPDBGuid, 0, 16);
memset(mWantPDBGuid, 0, 16);
memset(mPDBGuid, 0, 16);
mWantAge = -1;
mDebugAge = -1;
mFileAge = -1;
mCvMinTag = -1;
@ -5824,6 +5826,9 @@ bool COFF::LoadPDB(const String& pdbPath, uint8 wantGuid[16], int32 wantAge)
mDebugTarget->mWasLocallyBuilt = FileExists(pdbPath);
}
memcpy(mWantPDBGuid, wantGuid, 16);
mWantAge = wantAge;
mDbgSymRequest = mDebugger->mDbgSymSrv.CreateRequest(mFilePath, pdbPath, wantGuid, wantAge);
mDbgSymRequest->SearchLocal();
@ -6424,6 +6429,36 @@ void COFF::PreCacheDebugInfo()
}
}
bool COFF::LoadModuleImage(const StringImpl& imagePath)
{
if (!mDebugger->IsMiniDumpDebugger())
return false;
auto miniDumpDebugger = (MiniDumpDebugger*)mDebugger;
if (!imagePath.IsEmpty())
{
MappedFile* mappedFile = miniDumpDebugger->MapModule(this, imagePath);
mMappedImageFile = mappedFile;
if (mappedFile != NULL)
{
MemStream memStream(mappedFile->mData, mappedFile->mFileSize, false);
ReadCOFF(&memStream, false);
mOrigImageData = new DbgModuleMemoryCache(mImageBase, mImageSize);
}
}
if (mOrigImageData == NULL) // Failed?
{
mLoadState = DbgModuleLoadState_Failed;
return false;
}
return true;
}
bool COFF::RequestImage()
{
if (!mDebugger->IsMiniDumpDebugger())
@ -6455,27 +6490,7 @@ bool COFF::RequestImage()
mDebugger->mRunState = prevRunState;
if (!imagePath.IsEmpty())
{
MappedFile* mappedFile = miniDumpDebugger->MapModule(this, imagePath);
mMappedImageFile = mappedFile;
if (mappedFile != NULL)
{
MemStream memStream(mappedFile->mData, mappedFile->mFileSize, false);
ReadCOFF(&memStream, false);
mOrigImageData = new DbgModuleMemoryCache(mImageBase, mImageSize);
}
}
if (mOrigImageData == NULL) // Failed?
{
mLoadState = DbgModuleLoadState_NotLoaded;
return false;
}
return true;
return LoadModuleImage(imagePath);
}
else
{