Setup symbol path in win32 exception handler to the .exe folder

Otherwise it was trying lookup .pdb files only in the current folder,
as that is how .exe's are built (/pdbaltpath). This change now makes
exception handler to load .pdb from the same folder as where .exe is.
This commit is contained in:
Martins Mozeiko
2024-10-16 14:09:57 -07:00
committed by Ryan Fleury
parent 9c1f8ef37b
commit 9c016004c2
+5 -1
View File
@@ -1362,8 +1362,12 @@ win32_exception_filter(EXCEPTION_POINTERS* exception_ptrs)
HANDLE thread = GetCurrentThread();
CONTEXT* context = exception_ptrs->ContextRecord;
WCHAR module_path[MAX_PATH];
GetModuleFileNameW(NULL, module_path, ArrayCount(module_path));
PathRemoveFileSpecW(module_path);
dbg_SymSetOptions(SYMOPT_EXACT_SYMBOLS | SYMOPT_FAIL_CRITICAL_ERRORS | SYMOPT_LOAD_LINES | SYMOPT_UNDNAME);
if(dbg_SymInitializeW(process, L"", TRUE))
if(dbg_SymInitializeW(process, module_path, TRUE))
{
// check that raddbg.pdb file is good
B32 raddbg_pdb_valid = 0;