I have a c++ application compiled with MinGW for which I\'ve been receiving crash complaints from customers. So, besides heavily logging in the parts that might be crashing (bef
Actually the problem is not so much getting the crash reports to work. That is rather trivial with the DbgHelp library functions and most prominently there MiniDumpWriteDump
. Remember, however, to redistribute the DbgHelp library on older systems and observe the version requirements for the functions you intend to call - newer versions of Windows come with at least some version of this library.
Your problem with using a non-MS compiler (the problem also exists with the Embarcadero, formerly Borland, products, for example, or Watcom) is that the debug symbols created make no sense to the DbgHelp library - which is the standard facility for debugging on Windows. The PDB format is largely undocumented (for some clues search for the terms: Sven Schreiber PDB) and the libraries used to create them are not "public" in the same sense as the DbgHelp library - the latter can only be used to read/parse the created debug symbols. They are part of the Visual Studio products and usually named something like mspdbXY.dll (where XY are decimal digits).
So, if you want to create bug reports I strongly suggest that instead of concentrating on the "compiler issues", concentrate on the debugger issues. Here are the general directions in which you can go:
.map
files (I'm aware that such extensions were written some years ago for Borland .map
files)As an extension to 4 you can also let GCC create the .S
(assembly) files during compilation in order to cross-reference source code and crash dump when working without symbol support.
Given that I prefer GDB on unixoid platforms, but WinDbg and other debuggers on Windows, I cannot really say whether there is support for the actual crash dump format (created with MiniDumpWriteDump
) in GDB on Windows, so I'm not sure what format may be expected by GDB in this case.
BTW: if you use Windows XP or higher and can rely on that fact, use AddVectoredExceptionHandler
instead of SetUnhandledExceptionFilter
to prepare writing the crash dump.