views:

78

answers:

3

I have a Windows C++ app that crashes on user computers from time to time. I didnt write the app and it doesnt have its own logging. Is there a tool / utility I could use that is able to log some useful information when the application exits (e.g. the file and line number where the crash occurred)? The end user's component does not have Visual Studio.

A: 

You can use BugTrap which catches unhandled exceptions and reports them via email or other means. The setup is pretty simple. The only difficulty will be to correctly setup the *.pdb *.dll *.exe for the minidump.

Wernight
Does this work without building the app with debug information?
Christian Severin
It does but then you wont be able to use the Minidump. You can still use the Crash Explorer to get a stack trace without details.
Wernight
A: 

By adding dump generating to the program, you can use post-mortem debugging. Crash dump is created by MiniDumpWriteDump function. This dump can be sent to developer computer and debugged. More about this here:

http://www.codeproject.com/KB/debug/postmortemdebug_standalone1.aspx

Alex Farber
But isn't this possible only in cases where your app already includes debug information?
Christian Severin
Application must be built with debug information, but .pdb files are not distributed to destination computer. It is necessary to keep .pdb files for every released version and use them for post-mortem debugging, when necessary.
Alex Farber
+4  A: 

"the file and line number where the crash occurred"

That would be possible only if the code were built with debug information included. If your users are prepared to install VC++ Express, they could attach to the process with its debugger after the crash, but without the source they will simply see assembler code, and without debug information that may be of limited help in any case.

Clifford