Skip to content

Commit 9c01600

Browse files
mmozeikoryanfleury
authored andcommitted
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.
1 parent 9c1f8ef commit 9c01600

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/os/core/win32/os_core_win32.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,8 +1362,12 @@ win32_exception_filter(EXCEPTION_POINTERS* exception_ptrs)
13621362
HANDLE thread = GetCurrentThread();
13631363
CONTEXT* context = exception_ptrs->ContextRecord;
13641364

1365+
WCHAR module_path[MAX_PATH];
1366+
GetModuleFileNameW(NULL, module_path, ArrayCount(module_path));
1367+
PathRemoveFileSpecW(module_path);
1368+
13651369
dbg_SymSetOptions(SYMOPT_EXACT_SYMBOLS | SYMOPT_FAIL_CRITICAL_ERRORS | SYMOPT_LOAD_LINES | SYMOPT_UNDNAME);
1366-
if(dbg_SymInitializeW(process, L"", TRUE))
1370+
if(dbg_SymInitializeW(process, module_path, TRUE))
13671371
{
13681372
// check that raddbg.pdb file is good
13691373
B32 raddbg_pdb_valid = 0;

0 commit comments

Comments
 (0)