mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-13 22:04:09 +02:00
Added module name to stack traces
This commit is contained in:
parent
1e8004981f
commit
e4635f0f52
1 changed files with 26 additions and 11 deletions
|
@ -666,6 +666,12 @@ static String ImageHelpWalk(PCONTEXT theContext, int theSkipCount)
|
||||||
|
|
||||||
HANDLE hProcess = GetCurrentProcess();
|
HANDLE hProcess = GetCurrentProcess();
|
||||||
|
|
||||||
|
char szModule[MAX_PATH];
|
||||||
|
szModule[0] = 0;
|
||||||
|
uintptr section = 0, offset = 0;
|
||||||
|
|
||||||
|
GetLogicalAddress((PVOID)sf.AddrPC.Offset, szModule, sizeof(szModule), section, offset);
|
||||||
|
|
||||||
bool forceFail = false;
|
bool forceFail = false;
|
||||||
if ((gSymGetSymFromAddr(hProcess, sf.AddrPC.Offset, &symDisplacement, pSymbol)) && (!forceFail))
|
if ((gSymGetSymFromAddr(hProcess, sf.AddrPC.Offset, &symDisplacement, pSymbol)) && (!forceFail))
|
||||||
{
|
{
|
||||||
|
@ -685,8 +691,8 @@ static String ImageHelpWalk(PCONTEXT theContext, int theSkipCount)
|
||||||
dispName.Replace("::", ".");
|
dispName.Replace("::", ".");
|
||||||
}
|
}
|
||||||
|
|
||||||
aDebugDump += StrFormat("%@ %@ %hs+%X\r\n",
|
aDebugDump += StrFormat("%@ %@ %s %hs+%X\r\n",
|
||||||
sf.AddrFrame.Offset, sf.AddrPC.Offset, dispName.c_str(), symDisplacement);
|
sf.AddrFrame.Offset, sf.AddrPC.Offset, GetFileName(szModule).c_str(), dispName.c_str(), symDisplacement);
|
||||||
|
|
||||||
DWORD displacement = 0;
|
DWORD displacement = 0;
|
||||||
#ifdef BF64
|
#ifdef BF64
|
||||||
|
@ -703,11 +709,7 @@ static String ImageHelpWalk(PCONTEXT theContext, int theSkipCount)
|
||||||
}
|
}
|
||||||
else // No symbol found. Print out the logical address instead.
|
else // No symbol found. Print out the logical address instead.
|
||||||
{
|
{
|
||||||
char szModule[MAX_PATH];
|
|
||||||
szModule[0] = 0;
|
|
||||||
uintptr section = 0, offset = 0;
|
|
||||||
|
|
||||||
GetLogicalAddress((PVOID)sf.AddrPC.Offset, szModule, sizeof(szModule), section, offset);
|
|
||||||
|
|
||||||
// ModuleInfo* moduleInfo = NULL;
|
// ModuleInfo* moduleInfo = NULL;
|
||||||
// if (moduleInfoMap.TryAdd(szModule, NULL, &moduleInfo))
|
// if (moduleInfoMap.TryAdd(szModule, NULL, &moduleInfo))
|
||||||
|
@ -924,7 +926,7 @@ static void DoHandleDebugEvent(LPEXCEPTION_POINTERS lpEP)
|
||||||
aDebugDump += path;
|
aDebugDump += path;
|
||||||
aDebugDump += "\r\n";
|
aDebugDump += "\r\n";
|
||||||
aDebugDump += GetVersion(path);
|
aDebugDump += GetVersion(path);
|
||||||
aDebugDump += "Module: " + GetFileName(aBuffer) + "\r\n";
|
aDebugDump += "\r\n";
|
||||||
|
|
||||||
aDebugDump += StrFormat("Logical Address: %04X:%@\r\n", section, offset);
|
aDebugDump += StrFormat("Logical Address: %04X:%@\r\n", section, offset);
|
||||||
|
|
||||||
|
@ -997,7 +999,7 @@ CrashCatcher::CrashCatcher()
|
||||||
|
|
||||||
static long __stdcall SEHFilter(LPEXCEPTION_POINTERS lpExceptPtr)
|
static long __stdcall SEHFilter(LPEXCEPTION_POINTERS lpExceptPtr)
|
||||||
{
|
{
|
||||||
//OutputDebugStrF("SEH Filter! CraskReportKind:%d\n", gCrashReportKind);
|
OutputDebugStrF("SEH Filter! CraskReportKind:%d\n", gCrashReportKind);
|
||||||
|
|
||||||
if (gCrashReportKind == BfpCrashReportKind_None)
|
if (gCrashReportKind == BfpCrashReportKind_None)
|
||||||
{
|
{
|
||||||
|
@ -1027,9 +1029,22 @@ static long __stdcall SEHFilter(LPEXCEPTION_POINTERS lpExceptPtr)
|
||||||
return EXCEPTION_CONTINUE_SEARCH;
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//PVECTORED_EXCEPTION_HANDLER(
|
||||||
|
|
||||||
|
static long __stdcall VectorExceptionHandler(LPEXCEPTION_POINTERS lpExceptPtr)
|
||||||
|
{
|
||||||
|
OutputDebugStrF("VectorExceptionHandler\n");
|
||||||
|
return EXCEPTION_CONTINUE_SEARCH;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void CrashCatcher::Init()
|
void CrashCatcher::Init()
|
||||||
{
|
{
|
||||||
gPreviousFilter = SetUnhandledExceptionFilter(SEHFilter);
|
gPreviousFilter = SetUnhandledExceptionFilter(SEHFilter);
|
||||||
|
OutputDebugStrF("Setting SEH filter %p\n", gPreviousFilter);
|
||||||
|
|
||||||
|
// OutputDebugStrF("AddVectoredExceptionHandler 2\n");
|
||||||
|
// AddVectoredExceptionHandler(0, VectorExceptionHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CrashCatcher::Test()
|
void CrashCatcher::Test()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue