I have a native C++ application that works fine in the office (we do testing, of course), but clients experience numerous different crashes. I know one can windbg (it’s a crossplatform app – Win, Linux and Mac, but crashes occur on all platforms, so debugging either one is useful), but manipulating the client’s machine (installing and registering windbg, for example) isn’t an option. I wonder if there are other ways to get the call stack. Are there any tools that can instrument the binaries to provide such an information?
P. S. I can ship .pdb files along with the binaries, I guess, but I’d prefer not to.
On Windows you may configure Dr.Watson at client machine, so that if your application crashes it’ll create the so-called “minidump file”, which may then be opened by the debugger with the appropriate PDB.
You may also add an unhandled exception filter to your application and produce the minidump yourself in case of an irrecoverable error.
Edit:
In case you want to produce the dump file upon an (unhandled) exception – don’t do this inside the C++
catch (...)block, because it’s invoked after the unwind took place, and the original call stack is unavailable.In order to capture & dump the call stack you should dump it before the stack unwinding. Like this: