If you have installed WinDbg, use the menu File → Open Executable to open the application directly under the debugger and automatically debug it immediately.
Then you can use the commands under Debug (i.e. Go) for its normal operation and debugging. Also download SOS extensions . Not as good as Visual Studio, but useful if you only have EXE (and hopefully PDB, although this is optional) and no source.
Example. This is my source code, which we assume is not available:
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); int x = 10 - 10; int i = 2000/x; Application.Run(new Form1()); }
This will work immediately and you will not be able to attach the debugger on time. This is WinDbg output after clicking "Run":
ImageShack Dead Link Removed - Free Circles Me
After loading SOS.dll you can use! DumpStack to see where the exception was thrown:
ImageShack dead link removed - no Freehand Circles, sorry!
Please note that optimizing the JIT or compiler can lead to methods being built in, which may make StackTrace not 100% reliable, but it works for a quick overview.
WinDbg is a bit cryptic, but as soon as you got some basics, made it terrific and at least helped find the root of the problem.
source share