Did you know… What unwinding the call stack on unhandled exceptions does? – #277

Under Tools – Options – Debugging – General, after you’ve chosen to enabled the exception assistant, you’ll have the option to unwind the call stack on unhandled exceptions, as shown below:

Unwind the call stack on unhandled exceptions

The default is to have it checked… but when it is unchecked, meaning that you are not automatically unwinding the call stack, you’ll see the following $exception variable appear in the Locals window.

$exception shown in Locals window

I’m an IDE person, not a debugger person, so I’m hoping someone could comment on more of the details of what is going on here in this state, and under what conditions you would want to use or not use this option.

Technorati Tags: VS2005Tip,VS2008Tip

Comments (3)
  1. Mehrdad says:

    It’s a pretty well-described function. If you’re using third party code and it causes an exception [for example int.Parse("invalid integer");] by default the debugger AUTOMATICALLY unwinds the call stack until it reaches the first function in your code to be debugged. And it sets the next statement to the function call that caused the exception, so if you press continue again and again, you won’t see it quits the application. It just regenerates the exception. But if you don’t check it, the call stack remains as it was and if you press continue, the application will exit. If you uncheck it, you can MANUALLY unwind the stack to any frame you choose by right clicking a frame and choosing "unwind to this frame". Most of the time, the default case (automatic unwinding) works well unless you want to have precise control on the frame you want to unwind to or debugging low level code.

  2. Nicholas Cardi says:

    This may help to explain what is going on with this option checked or unchecked.


Comments are closed.

Skip to main content