Debugging Your Visual Basic Application
This page provides links to documentation for the debugging features that are built into Visual Studio. For example, you can find semantic errors in your application by observing its run-time behavior in the debugger itself.
By using the debugger, you can examine the content of variables in your application without inserting additional calls to output the values. Similarly, you can insert a breakpoint in your code to halt execution at the point that you specify.
Controlling Execution
The following table lists debugging tasks involving execution control and provides links to their associated Help pages.
To |
See |
Start to debug a Visual Studio project, attach to a process, break into code, step through code, run to the cursor, run to a function on the call stack, set the next statement, step through Just My Code, stop debugging, restart debugging, or detach from a debugged process. |
Start, Break, Step, Run through Code, and Stop Debugging in Visual Studio |
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. |
|
Enable just-in-time debugging, which launches the Visual Studio debugger when a program running outside Visual Studio encounters a fatal error. |
|
Set breakpoints for source lines, assembly instructions, and call stack function. Specify conditions, hit counts, and execution location. |
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 Threads window to examine and control threads in the program. |
See Also
Tasks
Walkthrough: Debugging a Windows Form
How to: Apply Edits in Break Mode with Edit and Continue
Concepts
Start, Break, Step, Run through Code, and Stop Debugging in Visual Studio
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