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.
This commit is contained in:
Ray molenkamp 2020-05-08 10:01:56 -06:00
parent a1c2441390
commit 96f305c63d
1 changed files with 15 additions and 1 deletions

View File

@ -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));
}