-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathfind-your-debugging-task.yml
More file actions
221 lines (147 loc) · 12.7 KB
/
find-your-debugging-task.yml
File metadata and controls
221 lines (147 loc) · 12.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
### YamlMime:FAQ
metadata:
title: "FAQ - Debugger feature finder"
description: Review frequently asked questions to help you identify the Visual Studio debugger feature to help you debug your application.
ms.date: "04/13/2026"
ms.topic: faq
f1_keywords:
- "vs.debug.uiref"
helpviewer_keywords:
- "debugging [Visual Studio], find your feature"
author: "mikejo5000"
ms.author: "mikejo"
manager: wiwagn
ms.workload:
- "multiple"
ms.subservice: debug-diagnostics
title: FAQ - Debugger feature finder
summary: |
This documentation addresses frequent questions about debugging features in Visual Studio. It also maps debugging tasks or issues to the relevant feature in the Visual Studio debugger. These links cover tasks or issues such as debugging multi-threaded application, code navigation, memory leak, inspecting variables, using breakpoints, external code debugging and many more. If you need an overview of debugger features, see [First look at the debugger](debugger-feature-tour.md) instead.
sections:
- name: Ignored
questions:
- question: |
Breakpoints
answer: |
- **How do I pause running code to inspect a line of code that may contain a bug?**
Set a breakpoint. For more information, see [Use the right type of breakpoint](using-breakpoints.md) and [Get started with breakpoints](get-started-with-breakpoints.md).
- **How do I pause running code based on specific criteria?**
Set the correct type of breakpoint. For more information, see [Use the right type of breakpoint](using-breakpoints.md).
- **How do I log information to the Output window under configurable conditions without modifying or stopping my code?**
Tracepoints allow you to log information to the Output window under configurable conditions without modifying or stopping your code. For more information, see [Use tracepoints in the Visual Studio debugger](../debugger/using-tracepoints.md).
- **Manage and keep track of my breakpoints**
Use the **Breakpoints** window. For more information, see [Manage breakpoints](get-started-with-breakpoints.md#BKMK_Specify_advanced_properties_of_a_breakpoint_).
- **Pause code and debug when a specific handled or unhandled exception is thrown**
Although the Exception Helper shows you where an error occurred, if you want to pause and debug the specific error, you can [tell the debugger to break when an exception is thrown](managing-exceptions-with-the-debugger.md#tell-the-debugger-to-break-when-an-exception-is-thrown).
- **Set a breakpoint from the call stack**
If you want to pause and debug code while examining execution flow or viewing functions in the **Call Stack** windows, see [Set a breakpoint in the Call Stack window](get-started-with-breakpoints.md#BKMK_Set_a_breakpoint_from_debugger_windows).
- **Pause code at a specific assembly instruction**
You can do this by [setting a breakpoint from the Disassembly window](get-started-with-breakpoints.md#BKMK_Set_a_breakpoint_from_debugger_windows).
- question: |
Navigate code
answer: |
- **How can I learn the commands to step through my code while debugging?**
For more information, see [Navigate code with the debugger](navigating-through-code-with-the-debugger.md).
- **Can I run the code to a particular line while skipping breakpoints without removing or disabling them?**
You can use “Force Run To Cursor” for these scenarios. You can keep your breakpoints and the debugger will skip over them until it reaches the line of code with the cursor.
It will also skip any of the first-chance exceptions break conditions that may occur.
For more information, see [Navigate code with the debugger](navigating-through-code-with-the-debugger.md#force-run-to-a-cursor-location).
- **If my line of code has calls to different methods, can I step into a specific method?**
Right-click on the line of code to bring up a context menu that allows you to select ‘Step Into Specific’. This will show a list of all the methods that you could step into.
You can now select the method of interest.
- question: |
Inspect and Visualize data
answer: |
- **How can I check the value of variables while running my app?**
Hover over variables using [data tips](view-data-values-in-data-tips-in-the-code-editor.md) or [inspect variables in the Autos and Locals window](autos-and-locals-windows.md).
- **Can I observe the changing value of a specific variable?**
Set a watch on the variable. For more information, see [Set a watch on variables](watch-and-quickwatch-windows.md).
- **How can I view strings that are too long for the debugger window?**
String Visualizer shows strings that are too long for a data tip or debugger window. It can also help you identify malformed strings.
Built-in [string visualizer](view-strings-visualizer.md) in Visual Studio include Text, XML, HTML, and JSON options.
- **How can I view large collection objects?**
The DataSet Visualizer allows you to view the contents of a DataSet, DataTable, DataView, or DataViewManager.
The IEnumerable Visualizer allows you to view objects such as Arrays, List, etc.
For more information, see [Tabular visualizers](view-data-in-tabular-visualizer.md).
- question: |
Debug an app that is already running
answer: |
- **How can I debug running apps on local or remote computers, debug multiple processes simultaneously, debug apps that weren't created in Visual Studio, or debug any app I didn't start from Visual Studio?**
See [Attach to a running processes](attach-to-running-processes-with-the-visual-studio-debugger.md).
- **How can I attach to the same application repeatedly?**
You can use **Reattach to Process** (**Shift+Alt+P**) to easily allow you to start debugging your application in one click without needing to go through the Attach to Process dialog every time.
See [Reattach to a process](attach-to-running-processes-with-the-visual-studio-debugger.md#BKMK_reattach).
- question: |
Debug multithreaded applications
answer: |
- **How can I debug a multi-threaded application? Or, is my application in a hung state?**
See [Parallel Stacks window](using-the-parallel-stacks-window.md) further troubleshooting.
- **How can I view the order in which functions are called?**
See [How to view the call stack](how-to-use-the-call-stack-window.md).
- question: |
Analyze memory
answer: |
- **Does my application have a memory leak?**
Take a snapshot and open it with memory tool to troubleshoot further.
See [Measure memory usage](../profiling/memory-usage.md).
- **How can I analyze memory usage for native or managed applications?**
Use the Visual Studio memory tool via live debugging, heap dumps, or the performance profiler.
See [Choose a memory analysis tool](../profiling/analyze-memory-usage.md).
- **How can I analyze memory usage for native or managed applications without attaching a debugger?**
Use the Visual Studio performance profiler with the memory usage tool enabled.
See [Analyze memory usage](../profiling/memory-usage-without-debugging2.md).
- **Can I compare memory usage between two points in time?**
Compare snapshots in the memory tool or compare two heap dumps using the diff functionality.
See [Analyze memory usage](../profiling/memory-usage-without-debugging2.md).
- question: |
External Code Debugging
answer: |
- **Can I see only user code while debugging?**
Just My Code is a Visual Studio debugging feature that automatically steps over calls to system, framework, and other non-user code.
In the Call Stack window, Just My Code collapses these calls into [External Code] frames.
See [Debug only user code with Just My Code](just-my-code.md).
- **How can I view or debug the raw assembly instructions that my program is executing?**
Use the Disassembly Window from Debug > Windows > Disassembly. You can step over one instruction at a time and even set breakpoints on individual assembly instructions.
- **Can I see source code for .NET Libraries?**
Enable Microsoft Symbol Servers from Debug > Options > Symbols in order to download symbols and source for .NET Libraries.
See [Specify symbol](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md).
- **How can I load PDBs from a specific or shared location or server?**
Configure your Symbol Servers from Debug > Options > Symbols.
See [Specify symbol](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md).
- **How can I never load a specific PDB? Or, how can I always load one?**
Configure your Include and Exclude Lists in Debug > Options > Symbols.
See [Specify symbol](specify-symbol-dot-pdb-and-source-files-in-the-visual-studio-debugger.md).
- question: |
Configure debugging
answer: |
- **How do I configure debugger settings?**
To configure debugger options and debugger project settings, see [Debugger settings and preparation](debugger-settings-and-preparation.md).
- **How can I customize information shown in the debugger?**
You may want to show information other than the object type as the value in different debugger windows. For C#, Visual Basic, F#, and C++/CLI code, use the [DebuggerDisplay](using-the-debuggerdisplay-attribute.md) attribute. For more advanced options, you can also customize the UI by creating a [custom visualizer](create-custom-visualizers-of-data.md).
For native C++, use the [NatVis framework](create-custom-views-of-native-objects.md).
- question: |
Additional tasks
answer: |
- **Do I need to save a dump?**
While stopped at an error or breakpoint during debugging, select **Debug > Save Dump As**.
See [Dump files](using-dump-files.md).
- **How do I analyze a dump file?**
Open the dump by choosing **File > Open** in Visual Studio. To start debugging, select **Debug with Managed Only**, **Debug with Native Only**, **Debug with Mixed**, or **Debug with Managed Memory**.
See [Dump files](using-dump-files.md).
- **Can I edit code during a debugging session?**
Use [Hot Reload](hot-reload.md), previously called Edit and Continue. For XAML, use [XAML Hot Reload](../xaml-tools/xaml-hot-reload.md).
- **How can I debug on remote machines?**
See [Remote debugging](remote-debugging.md).
- **How can I fix performance issues?**
See [First look at the profiling tools](../profiling/profiling-feature-tour.md).
- **How do I fix an exception?**
See [Fix an exception](write-better-code-with-visual-studio.md#fix-an-exception).
- question: |
AI-assisted debugging
answer: |
- **How can I get AI assistance while debugging?**
If you have Copilot, look for the **Analyze with Copilot** or **Ask Copilot** button in debugger windows like the Exception Helper, data tips, and variables windows. Copilot already knows your debugging context.
See [Debug with Copilot](debug-with-copilot.md).
- **How do I use the Debugger Agent for end-to-end bug resolution?**
The Debugger Agent provides an agentic workflow that reproduces bugs, instruments your app, and validates fixes using live runtime data. Select **Debugger** from the mode dropdown in the Copilot Chat window and provide an issue link or describe the bug.
See [Agentic bug resolution with the Debugger Agent](debug-with-copilot.md#agentic-bug-resolution-with-the-debugger-agent).