Not too long ago, I had a problem which required me to set WinDbg.exe as the default post-mortem debugger. Now that I've fixed that and am back doing normal work, it would be really nice if I could set VS to be my default post-mortem debugger. How does one go about doing this?
Also, how do I make VS attach to an already existing session? That is, I've got my VS project open in one window, and a command line open where I'm launching my program from. If the program crashes, how do I get VS to figure out to attach the debugger to the active line in the project that's already open?
To set Visual Studio debugger options, select Tools > Options, and under Debugging select or deselect the boxes next to the General options. You can restore all default settings with Tools > Import and Export Settings > Reset all settings.
To set the postmortem debugger to WinDbg, run windbg -I . (The I must be capitalized.) This command will display a success or failure message after it is used. To work with both 32 and 64 bit applications, run the command for the both the 64 and 32 debuggers.
In Solution Explorer, right-click the project and choose Properties. In the Configuration list, choose Debug or Release. In the side pane, choose Linker > Debugging, then select options for Generate Debug Info. In most C++ projects, the default value is Generate Debug Information (/DEBUG).
In the Visual Studio toolbar, make sure the configuration is set to Debug. To start debugging, select the profile name in the toolbar, such as <project profile name>, IIS Express, or <IIS profile name> in the toolbar, select Start Debugging from the Debug menu, or press F5.
You can re-enable Visual Studio for Just-In-Time debugging from within Visual Studio:
Go to the Tools | Options | Debugging | Just-In-Time dialog. Then make sure all Native and Managed (if you're debugging a .NET application) are checked. Next time you get a crash, the Visual Studio Just-In-Time debugger will come up.
The Visual Studio Just-In-Time debugger let's you choose whether you want to open a new instance of Visual Studio or start debugging with a currently open solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With