Compartir a través de


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.

Debug and Release Project Configurations

Set start options (command-line arguments, working directory, remote machine)

How to: Set Start Options for Application Debugging

Debug at design time.

Walkthrough: Debugging 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.

Just-In-Time Debugging in Visual Studio

Set breakpoints for source lines, assembly instructions, and call stack function. Specify conditions, hit counts, and execution location.

Breakpoints: Use Hit Counts, Call Stack Functions, and Conditions to Break When and Where You Want in the Visual Studio Debugger

Handling Exceptions

The following table lists debugging tasks involving exception handling and points to their associated Help pages.

To

See

Break on unhandled exceptions.

How to: Break on User-Unhandled Exceptions

Break when an exception is thrown.

How to: Break When an Exception is Thrown

Break on first-chance exceptions.

How to: Break When an Exception is Thrown

Use the exception assistant.

How to: Correct Run-Time Errors with the Exception Assistant

Add a new exception.

How to: Add New Exceptions

Continue execution after an exception has been thrown.

Continuing Execution After an Exception

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.

How to: Enable and Disable Edit and Continue

Stop Edit and Continue from applying code changes.

How to: Stop Code Changes

Apply edits in break mode.

How to: Apply Edits in Break Mode with Edit and Continue

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.

How to: Use the Registers Window

Use the Call Stack window to view function or procedure calls that are currently on the stack.

How to: Use the Call Stack Window

Use the Disassembly window to view assembly code corresponding to the instructions created by the compiler.

How to: Use the Disassembly Window

Use the Modules window to list and describe modules used by your program.

How to: Use the Modules Window

Use the Script Explorer window to list script files that are currently loaded into the program.

How to: View Script Documents

Use the Threads window to examine and control threads in the program.

How to: Use the Threads Window

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 Managed Code

Debugging Native Code

Debugging Web Applications and Script

Debugging User Interface Reference

Debug Settings and Preparation

Debugger Roadmap

Debugging Preparation: C#, F#, and Visual Basic Project Types