Skip to content

Commit 51a86d0

Browse files
authored
Merge pull request #5709 from Mikejo5000/mikejo-br16
Updates to breakpoints topic
2 parents d79e1a6 + cf01e20 commit 51a86d0

File tree

5 files changed

+138
-142
lines changed

5 files changed

+138
-142
lines changed

docs/debugger/find-your-debugging-task.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ Otherwise, for C# and F# only, you can [track an object ID with a conditional br
3737

3838
### Pause code inside a loop at a certain iteration
3939

40-
Set a breakpoint using **Hit count** as a condition. For more information, see [Hit count](using-breakpoints.md#hit-count).
40+
Set a breakpoint using **Hit count** as a condition. For more information, see [Hit count](using-breakpoints.md#set-a-hit-count-condition).
4141

4242
### Pause code at the start of a function when you know the function name but not its location
4343

4444
You can do this with a function breakpoint. For more information, see [Set function breakpoints](using-breakpoints.md#BKMK_Set_a_breakpoint_in_a_source_file).
4545

46+
### Pause code at the start of multiple functions with the same name
47+
48+
When you have multiple functions with the same name (overloaded functions or functions in different projects), you can use a [function breakpoint](using-breakpoints.md#BKMK_Set_a_breakpoint_in_a_source_file).
49+
4650
### Manage and keep track of your breakpoints
4751

4852
Use the **Breakpoints** window. For more information, see [Manage breakpoints](using-breakpoints.md#BKMK_Specify_advanced_properties_of_a_breakpoint_).
@@ -101,6 +105,10 @@ Use [Edit and continue](edit-and-continue.md). For XAML, use [XAML Hot Reload](.
101105

102106
Set a tracepoint. For more information, see [Using tracepoints](using-tracepoints.md).
103107

108+
## View the order in which functions are called
109+
110+
See [How to view the call stack](how-to-use-the-call-stack-window.md).
111+
104112
### Debug on remote machines
105113

106114
See [Remote debugging](remote-debugging.md).
Loading

docs/debugger/navigating-through-code-with-the-debugger.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,32 @@ ms.workload:
2020

2121
The Visual Studio debugger can help you navigate through code to inspect the state of an app and show its execution flow. You can use keyboard shortcuts, debug commands, breakpoints, and other features to quickly get to the code you want to examine. Familiarity with debugger navigation commands and shortcuts makes it faster and easier to find and resolve app issues. If this is the first time that you've tried to debug code, you may want to read [Debugging for absolute beginners](../debugger/debugging-absolute-beginners.md) and [Debugging techniques and tools](../debugger/write-better-code-with-visual-studio.md) before going through this article.
2222

23-
## Basic debugging
23+
## Get into "break mode"
2424

25-
To start your app with the debugger attached, press **F5**, select **Debug** > **Start Debugging**, or select the green arrow in the Visual Studio toolbar.
25+
In *break mode*, app execution is suspended while functions, variables, and objects remain in memory. Once the debugger is in break mode, you can navigate through your code. The most common ways to get into break mode quickly is to either:
2626

27-
![DBG_Basics_Start_Debugging](../debugger/media/dbg_basics_start_debugging.png "DBG_Basics_Start_Debugging")
27+
- Begin code stepping by pressing **F10** or **F11**. This allows you to quickly find the entry point of your app, then you can continue pressing step commands to navigate code.
2828

29-
While you're debugging, a yellow highlight shows the code line that will execute next.
29+
- [Run to a specific location or function](#BKMK_Break_into_code_by_using_breakpoints_or_Break_All), for example, by [setting a breakpoint](using-breakpoints.md) and starting your app.
3030

31-
![DBG_Basics_Break_Mode](../debugger/media/dbg_basics_break_mode.png "Break mode")
31+
For example, from the code editor in Visual Studio, you can use the **Run to Cursor** command to start the app, debugger attached, and get into break mode, then **F11** to navigate code.
3232

33-
Most debugger windows, like the **Modules** and **Watch** windows, are available only while the debugger is running. Some debugger features, such as viewing variable values in the **Locals** window or evaluating expressions in the **Watch** window, are available only while the debugger is paused at a breakpoint, also called *break mode*.
33+
![Run to cursor and step into code](../debugger/media/navigate-code-code-stepping.gif "Run to cursor and step into code")
3434

35-
In break mode, app execution is suspended while functions, variables, and objects remain in memory. You can examine the elements' positions and states to look for violations or bugs. For some project types, you can also make adjustments to the app while in break mode. For a video showing these features, see [Getting Started with the Debugger](https://www.youtube.com/watch?v=FtGCi5j30YU&list=PLReL099Y5nRfw6VNvzMkv0sabT2crbSpK&index=6).
35+
Once in break mode, you can use a variety of commands to navigate through your code. While in break mode, you can examine the values of variables to look for violations or bugs. For some project types, you can also make adjustments to the app while in break mode.
3636

37-
If you break in code that doesn't have source or symbol (*.pdb*) files loaded, the debugger displays a **Source Files Not Found** or **Symbols Not Found** page that can help you find and load the files. See [Specify symbol (.pdb) and source files](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md). If you can't load the symbol or source files, you can still debug the assembly instructions in the **Disassembly** window.
37+
Most debugger windows, like the **Modules** and **Watch** windows, are available only while the debugger is attached to your app. Some debugger features, such as viewing variable values in the **Locals** window or evaluating expressions in the **Watch** window, are available only while the debugger is paused (that is, in break mode).
3838

39-
You don't always have to start debugging by starting an app at the beginning. You can also press **F11** to [step into code](#BKMK_Step_into__over__or_out_of_the_code), press **F10** to [step over code](#BKMK_Step_over_Step_out), or [run to a specific location or function](#BKMK_Break_into_code_by_using_breakpoints_or_Break_All).
39+
> [!NOTE]
40+
> If you break into code that doesn't have source or symbol (*.pdb*) files loaded, the debugger displays a **Source Files Not Found** or **Symbols Not Found** page that can help you find and load the files. See [Specify symbol (.pdb) and source files](../debugger/specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md). If you can't load the symbol or source files, you can still debug the assembly instructions in the **Disassembly** window.
4041
4142
## Step through code
4243

4344
The debugger step commands help you inspect your app state or find out more about its execution flow.
4445

45-
If you need to find the entry point in your app, start with **F10** or **F11**.
46-
4746
### <a name="BKMK_Step_into__over__or_out_of_the_code"></a> Step into code line by line
4847

49-
To stop on each line of code or statement while debugging, use **Debug** > **Step Into**, or press **F11**.
48+
To stop on each statement while debugging, use **Debug** > **Step Into**, or press **F11**.
5049

5150
The debugger steps through code statements, not physical lines. For example, an `if` clause can be written on one line:
5251

@@ -67,11 +66,11 @@ However, when you step into this line, the debugger treats the condition as one
6766
On a nested function call, **Step Into** steps into the most deeply nested function. For example, if you use **Step Into** on a call like `Func1(Func2())`, the debugger steps into the function `Func2`.
6867

6968
>[!TIP]
70-
>As you execute each line of code, you can hover over variables to see their values, or use the [Locals](autos-and-locals-windows.md) and [Watch](watch-and-quickwatch-windows.md) windows to watch the values change. You can also visually trace the call stack while stepping into functions. See [Map methods on the call stack while debugging](../debugger/map-methods-on-the-call-stack-while-debugging-in-visual-studio.md).
69+
>As you execute each line of code, you can hover over variables to see their values, or use the [Locals](autos-and-locals-windows.md) and [Watch](watch-and-quickwatch-windows.md) windows to watch the values change. You can also visually trace the [call stack](how-to-use-the-call-stack-window.md) while stepping into functions. (For Visual Studio Enterprise only, see [Map methods on the call stack while debugging](../debugger/map-methods-on-the-call-stack-while-debugging-in-visual-studio.md)).
7170
7271
### <a name="BKMK_Step_over_Step_out"></a> Step through code and skip some functions
7372

74-
You may not care about a function while debugging, or you know it works, like well-tested library code. You can use the following commands to skip through code. The functions still execute, but the debugger skips over them.
73+
You may not care about a function while debugging, or you know it works, like well-tested library code. You can use the following commands to skip code while code stepping. The functions still execute, but the debugger skips over them.
7574

7675
|Keyboard command|Debug menu command|Description|
7776
|----------------------|------------------|-----------------|

0 commit comments

Comments
 (0)