From 96f305c63d5b6002a10bcbffcf0407c43356f32d Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Fri, 8 May 2020 10:01:56 -0600 Subject: Windows: Include symbol file in module information When writing out the module information in a crashdump we did not include what symbol file was loaded and if that symbol file actually matches our executable. Given the backtraces may contain invalid information if the symbols are unmatched this is relevant to know. This diff adds the symbol file and an indication if unmatched symbols are used. --- source/blender/blenlib/intern/system_win32.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/system_win32.c b/source/blender/blenlib/intern/system_win32.c index 5a633755c79..203c9673a9e 100644 --- a/source/blender/blenlib/intern/system_win32.c +++ b/source/blender/blenlib/intern/system_win32.c @@ -253,7 +253,21 @@ static void bli_windows_system_backtrace_modules(FILE *fp) if (me32.th32ProcessID == GetCurrentProcessId()) { char version[MAX_PATH]; bli_windows_get_module_version(me32.szExePath, version, sizeof(version)); - fprintf(fp, "0x%p %-20s %s\n", me32.modBaseAddr, version, me32.szModule); + + IMAGEHLP_MODULE64 m64; + m64.SizeOfStruct = sizeof(m64); + if (SymGetModuleInfo64(GetCurrentProcess(), (DWORD64)me32.modBaseAddr, &m64)) { + fprintf(fp, + "0x%p %-20s %s %s %s\n", + me32.modBaseAddr, + version, + me32.szModule, + m64.LoadedPdbName, + m64.PdbUnmatched ? "[unmatched]" : ""); + } + else { + fprintf(fp, "0x%p %-20s %s\n", me32.modBaseAddr, version, me32.szModule); + } } } while (Module32Next(hModuleSnap, &me32)); } -- cgit v1.2.3