Skip to content

Commit 41d2939

Browse files
committed
edits
1 parent 25d9ac6 commit 41d2939

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

docs/debugger/get-started-with-breakpoints.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Get started with breakpoints
33
description: Learn about breakpoints, one of the most important debugging techniques.
4-
ms.date: 08/13/2024
4+
ms.date: 11/22/2024
55
ms.topic: how-to
66
f1_keywords:
77
- vs.debug.breakpointswin
@@ -22,22 +22,30 @@ ms.author: mikejo
2222
manager: mijacobs
2323
ms.subservice: debug-diagnostics
2424
---
25-
# Use breakpoints in the Visual Studio debugger
25+
# Get started with breakpoints in the Visual Studio debugger
2626

27-
Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint. If you are trying to resolve a warning or issue while using breakpoints, see [Troubleshoot breakpoints in the Visual Studio debugger](../debugger/troubleshooting-breakpoints.md).
28-
29-
> [!NOTE]
30-
> If you know the task or problem you're trying to solve, but you need to know what kind of breakpoint to use, see [FAQ - Find your debugging feature](../debugger/find-your-debugging-task.yml#breakpoints).
27+
Breakpoints are one of the most important debugging techniques in your developer's toolbox. You set breakpoints wherever you want to pause debugger execution. For example, you may want to see the state of code variables or look at the call stack at a certain breakpoint.
3128

3229
## <a name="BKMK_Overview"></a> Set breakpoints in source code
3330

34-
You can set a breakpoint on any line of executable code. For example, in the following C# code, you could set a breakpoint on the line of code with the variable assignment (`int testInt = 1`), the `for` loop, or any code inside the `for` loop. You can't set a breakpoint on method signatures, declarations for a namespace or class, or variable declarations if there's no assignment and no getter/setter.
31+
You can set a breakpoint on any line of executable code. For example, take a look at this simple C# code that creates a simple loop.
32+
33+
```csharp
34+
int testInt = 3;
35+
36+
for (int i = 0; i < 10; i++)
37+
{
38+
testInt += i;
39+
}
40+
```
41+
42+
You could set a breakpoint on the line of code with the variable assignment (`int testInt = 3`), the `for` loop, or any code inside the `for` loop. You can't set a breakpoint on method signatures, declarations for a namespace or class, or variable declarations if there's no assignment and no getter/setter.
3543

3644
To set a breakpoint in source code:
3745

3846
- Click in the far left margin next to a line of code. You can also select the line and press **F9**, select **Debug** > **Toggle Breakpoint**, or right-click and select **Breakpoint** > **Insert breakpoint**. The breakpoint appears as a red dot in the left margin.
3947

40-
For most languages including C#, breakpoint and current execution lines are automatically highlighted. For C++ code, you can turn on highlighting of breakpoint and current lines by selecting **Tools** (or **Debug**) > **Options** > **Debugging** > **Highlight entire source line for breakpoints and current statement (C++ only)**.
48+
For most languages, including C#, Visual Studio automatically highlights breakpoint and current execution lines. For C++ code, you can turn on highlighting of breakpoint and current lines by selecting **Tools** (or **Debug**) > **Options** > **Debugging** > **Highlight entire source line for breakpoints and current statement (C++ only)**.
4149

4250
::: moniker range=">= vs-2022"
4351
![Set a breakpoint](../debugger/media/vs-2022/basic-breakpoint.png "Basic breakpoint")
@@ -70,6 +78,10 @@ Here are a few general instructions for working with breakpoints.
7078

7179
- Set conditions and actions, add and edit labels, or export a breakpoint by right-clicking it and selecting the appropriate command, or hovering over it and selecting the **Settings** icon.
7280

81+
## Types of breakpoints
82+
83+
Visual Studio supports different types of breakpoints to support different debugging scenarios, such as conditional breakpoints that only activate based on specified criteria. For more information, see [Use the right type of breakpoint](../debugger/using-breakpoints.md).
84+
7385
## <a name="BKMK_Specify_advanced_properties_of_a_breakpoint_"></a> Manage breakpoints in the Breakpoints window
7486

7587
You can use the **Breakpoints** window to see and manage all the breakpoints in your solution. This centralized location is especially helpful in a large solution, or for complex debugging scenarios where breakpoints are critical.

0 commit comments

Comments
 (0)