mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 03:28:20 +02:00
!pdbtest, extra PDB reading robustness
This commit is contained in:
parent
4afc8eb3dc
commit
c12aea02be
3 changed files with 62 additions and 2 deletions
|
@ -18,6 +18,7 @@
|
|||
#include "BeefySysLib/util/UTF8.h"
|
||||
#include "BeefySysLib/FileStream.h"
|
||||
#include "BeefySysLib/FileHandleStream.h"
|
||||
#include "BeefySysLib/util/FileEnumerator.h"
|
||||
#include <inttypes.h>
|
||||
#include <windows.h>
|
||||
#include "DbgExprEvaluator.h"
|
||||
|
@ -9387,6 +9388,42 @@ void WinDebugger::EvaluateContinueKeep()
|
|||
mDebugPendingExpr->mIdleTicks = 0;
|
||||
}
|
||||
|
||||
static void PdbTestFile(WinDebugger* debugger, const StringImpl& path)
|
||||
{
|
||||
if (!path.EndsWith(".PDB", StringImpl::CompareKind_OrdinalIgnoreCase))
|
||||
return;
|
||||
|
||||
OutputDebugStrF("Testing %s\n", path.c_str());
|
||||
COFF coffFile(debugger->mDebugTarget);
|
||||
uint8 wantGuid[16] = { 0 };
|
||||
if (!coffFile.TryLoadPDB(path, wantGuid, -1))
|
||||
return;
|
||||
if (!coffFile.mIs64Bit)
|
||||
return;
|
||||
coffFile.ParseTypeData();
|
||||
coffFile.ParseSymbolData();
|
||||
coffFile.ParseGlobalsData();
|
||||
}
|
||||
|
||||
static void PdbTest(WinDebugger* debugger, const StringImpl& path)
|
||||
{
|
||||
for (auto& fileEntry : FileEnumerator(path, FileEnumerator::Flags_Files))
|
||||
{
|
||||
String filePath = fileEntry.GetFilePath();
|
||||
|
||||
PdbTestFile(debugger, filePath);
|
||||
}
|
||||
|
||||
for (auto& fileEntry : FileEnumerator(path, FileEnumerator::Flags_Directories))
|
||||
{
|
||||
String childPath = fileEntry.GetFilePath();
|
||||
String dirName;
|
||||
dirName = GetFileName(childPath);
|
||||
|
||||
PdbTest(debugger, childPath);
|
||||
}
|
||||
}
|
||||
|
||||
String WinDebugger::Evaluate(const StringImpl& expr, DwFormatInfo formatInfo, int callStackIdx, int cursorPos, int language, DwEvalExpressionFlags expressionFlags)
|
||||
{
|
||||
BP_ZONE_F("WinDebugger::Evaluate %s", BP_DYN_STR(expr.c_str()));
|
||||
|
@ -9471,6 +9508,10 @@ String WinDebugger::Evaluate(const StringImpl& expr, DwFormatInfo formatInfo, in
|
|||
mDbgBreak = true;
|
||||
return "";
|
||||
}
|
||||
else if (cmd == "!pdbtest")
|
||||
{
|
||||
PdbTest(this, "c:\\");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue