We’re running an application, happens to be web server we’ve written, and we’re saying some nasty issues only in production, so for about 12 hours we’re going to put this under WinDBG and take callstacks every time it breaks.
Sometimes it’ll break because of an unhandled exception, and sometimes we’ll hit an assert, at which point our code says if running under a debugger, break.
Is it possible to hook into WinDBG in such a way that as soon it breaks, it takes a callstack, and moves on immediately?
Attaching a debugger to a production box can be disastrous, (a) performance (b) unexpected breaks into the debugger
As a safety, definately make sure you disable all exceptions you don’t care about or will not want to break into the debugger.
Then, choose the ones you’d like to handle in some fashion (take callstack, and move on)
The first one is a break point exception handler, assert failure, and C++ EH exception.
There’s a huge list of what your debugger supports, for example if you load SOS.dll (the CLR extension to WinDBG) then you’ll be able to
For authoritative information on types of exception/events you can potentially filter on, see the WinDbg help (search for sxe)