Did you know? You can unwind the call stack from exceptions (Bill Horst)


The ability to unwind the call stack from exceptions is one of the debugger features that was newly introduced in Visual Basic.NET 2005. When the debugger hits a first-chance exception, you can unwind the call stack in order to make code edits to fix the exception and continue debugging with the changes. The exception assistant UI will have an “Enable Editing” option which will unwind the debugger to the topmost call stack frame with code in the current solution.

When an exception is unhandled, the unwind will occur automatically, but this can be turned on and off from the Options dialog (under Tools).

If you attempt to edit code after an exception has been hit, but before an unwind, you’re allowed the option of unwinding and editing the code, stopping the debugging session, or canceling the edit.

The user can also unwind from the call stack window, by right-clicking the desired frame and selecting “Unwind To This Frame”. This is only available when an exception has been hit and not yet unwound, and only on frames sufficiently high on the call stack.

We hope that this functionality will allow you to be more effective in their debugging, and will help you better leverage the “Edit and Continue” capabilities in Visual Basic.


Leave a comment

Feedback usabilla icon