You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/debugger/find-your-debugging-task.md
+9-1Lines changed: 9 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -37,12 +37,16 @@ Otherwise, for C# and F# only, you can [track an object ID with a conditional br
37
37
38
38
### Pause code inside a loop at a certain iteration
39
39
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).
41
41
42
42
### Pause code at the start of a function when you know the function name but not its location
43
43
44
44
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).
45
45
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
+
46
50
### Manage and keep track of your breakpoints
47
51
48
52
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](.
101
105
102
106
Set a tracepoint. For more information, see [Using tracepoints](using-tracepoints.md).
103
107
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).
Copy file name to clipboardExpand all lines: docs/debugger/navigating-through-code-with-the-debugger.md
+13-14Lines changed: 13 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -20,33 +20,32 @@ ms.workload:
20
20
21
21
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.
22
22
23
-
## Basic debugging
23
+
## Get into "break mode"
24
24
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:
- 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.
28
28
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.
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.
32
32
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
+

34
34
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.
36
36
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).
38
38
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.
40
41
41
42
## Step through code
42
43
43
44
The debugger step commands help you inspect your app state or find out more about its execution flow.
44
45
45
-
If you need to find the entry point in your app, start with **F10** or **F11**.
46
-
47
46
### <aname="BKMK_Step_into__over__or_out_of_the_code"></a> Step into code line by line
48
47
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**.
50
49
51
50
The debugger steps through code statements, not physical lines. For example, an `if` clause can be written on one line:
52
51
@@ -67,11 +66,11 @@ However, when you step into this line, the debugger treats the condition as one
67
66
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`.
68
67
69
68
>[!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)).
71
70
72
71
### <aname="BKMK_Step_over_Step_out"></a> Step through code and skip some functions
73
72
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.
0 commit comments