Debugging Your Visual Basic Application
This page provides pointers to documentation for the debugging features built into Visual Studio.
You can use the most important of these, the debugger, to observe the run-time behavior of your program and to determine the location of semantic errors.
Using the debugger, you can examine the content of variables in your program without inserting additional calls to output the values. Similarly, you can insert a breakpoint in your code to halt execution at the desired point.
Controlling Execution
The following table lists debugging tasks involving execution control and provides links to their associated Help pages.
To |
See |
Break execution. |
|
Start execution. |
|
Specify the configurations for the debug and release versions of a program. |
|
Set start options (command-line arguments, working directory, remote machine) |
|
Debug at design time. |
|
Launch the debugger. |
|
Step into only the code you have written and ignore other code, such as system calls. |
|
Step into code. |
|
Stop debugging. |
|
Enable just-in-time debugging, which launches the Visual Studio debugger when a program running outside Visual Studio encounters a fatal error. |
Handling Exceptions
The following table lists debugging tasks involving exception handling and points to their associated Help pages.
To |
See |
Break on unhandled exceptions. |
|
Break when an exception is thrown. |
|
Break on first-chance exceptions. |
|
Use the exception assistant. |
How to: Correct Run-Time Errors with the Exception Assistant |
Add a new exception. |
|
Continue execution after an exception has been thrown. |
Edit and Continue
The following table lists debugging tasks involving Edit and Continue and points to their associated Help pages.
To |
See |
Turn Edit and Continue off and on. |
|
Stop Edit and Continue from applying code changes. |
|
Apply edits in break mode. |
Examining Debugging Data
The following table lists debugging tasks involving viewing debugging data and points to their associated Help pages.
To |
See |
Use the Registers window to display register contents. |
|
Use the Call Stack window to view function or procedure calls that are currently on the stack. |
|
Use the Disassembly window to view assembly code corresponding to the instructions created by the compiler. |
|
Use the Modules window to list and describe modules used by your program. |
|
Use the Script Explorer window to list script files that are currently loaded into the program. |
|
Use the Processes window to show all processes that you have attached to or launched from Visual Studio. |
|
Use the Threads window to examine and control threads in the program. |
Setting Breakpoints
The following table lists debugging tasks involving breakpoints and points to their associated Help pages.
To |
See |
Set a breakpoint. |
|
Delete a breakpoint. |
|
Enable or disable a breakpoint. |
|
Change a breakpoint location. |
|
Use a filter to limit the behavior of a breakpoint to specified computers, processes, and threads. |
|
Conditionally control whether or not a breakpoint is executed. |
|
Use the Breakpoints window to accomplish breakpoint-related tasks. |
See Also
Tasks
Walkthrough: Debugging a Windows Form
How to: Apply Edits in Break Mode with Edit and Continue
Concepts
Debug Your App by Recording Code Execution with IntelliTrace
Other Resources
Debugging Web Applications and Script
Debugging User Interface Reference
Debug Settings and Preparation
Debugging Preparation: C#, F#, and Visual Basic Project Types