Debugging release build on a client's machine
We are able to get crash dumps from our Release builds out in the field and do not need to ship the pdb files with our product.
We build in calls to create the crash dump file ourselves in our top-level exception handler using MiniDumpWriteDump(). But even without that, you could have the user generate the crash file at the point of the crash using task manager as documented here: MSDN Instructions for creating dump file.
Once you have the dump file, the customer zips and mails it to you and you drop it onto Visual Studio. Within VS, you then pick Debug with Mixed or Debug with Native Only and it uses your local copy of the pdb files to show you the call stack, etc.
The process you should have looks like this:
- Compile an executable and generate a PDB file. Make sure you don't make any changes to the code used for the executable, or keep a backup.
- Ship the executable to the client. No need to ship the PDB file. The only reason to do ship it is if you'd like to debug on the client's machine, or use tools like Process Explorer to get a stack trace with function names at some point. Neither seem to be applicable in your case.
- If it's an XP/2003 machine, use drwtsn32 to configure the creation of a crash dump. If it's Vista/7/2008, drwtsn32 is retired, and you should configure WER instead. Another option is using ADPlus to launch you app.
- Once the crash occurs, have the dump delivered back to you, and load it in Visual Studio. You must have the exact same code, executable and PDB at hand in order to debug smoothly.
Note:
- WinDbg is useful for debugging on production environment. It is a very strong debugger and it's portable, but if you're used to VS, you'll be more comfortable using it.
- If you create a minidump, you'll get stack traces and some variables values. If you create a full dump, you'll get the complete heap, including all variables - and a much larger dump file... If the transfer is not a problem, use full dumps.
- If you register at Microsoft, you can have access to dumps created when your program crashes on clients sites. It's that annoying "Send the info to Microsoft?" window you get when a process crashes that will send the dump to MS, and you'll have access to it...
I feel your pain. Had to do that a while ago.
Anyway, have you tried google Breakpad ?
Breakpad is a library and tool suite that allows you to distribute an application to users with compiler-provided debugging information removed, record crashes in compact "minidump" files, send them back to your server, and produce C and C++ stack traces from these minidumps. Breakpad can also write minidumps on request for programs that have not crashed.
Breakpad is currently used by Google Chrome, Firefox, Google Picasa, Camino, Google Earth, and other projects
You can find it here : http://code.google.com/p/google-breakpad/
It does the same things as the other answers mentioned, but it does it automatically, saviong you a lot of time and efforts