Skip to content

Commit a7d57b8

Browse files
authored
Merge pull request #13309 from Mikejo5000/mikejo-br25
Update debugger content for viewing return values
2 parents 4b39b94 + 5ffdc5f commit a7d57b8

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

docs/debugger/autos-and-locals-windows.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Inspect variables - Autos and Locals windows
33
description: Inspect variables in the Autos and Locals windows while debugging in Visual Studio. The Autos and Locals windows show variable values while you are debugging.
4-
ms.date: 09/06/2024
4+
ms.date: 11/05/2024
55
ms.topic: how-to
66
f1_keywords:
77
- vs.debug.autos
@@ -167,6 +167,9 @@ Different code languages display different variables in the **Autos** window.
167167
168168
In .NET and C++ code, you can examine return values in the **Autos** window when you step over or out of a method call. Viewing method call return values can be useful when they are not stored in local variables. A method could be used as a parameter, or as the return value of another method.
169169
170+
> [!NOTE]
171+
> Starting in Visual Studio 2022 version 17.12 Preview 3, you can also view [return values inline](../debugger/debugger-feature-tour.md#view-return-values-of-method-calls) and not just in the Autos window.
172+
170173
For example, the following C# code adds the return values of two functions:
171174
172175
```csharp
@@ -198,7 +201,7 @@ To see the return values of the `sumVars()` and `subtractVars()` method calls in
198201
1. Start debugging, and when execution pauses at the breakpoint, select **Step Over** or press **F10**. You should see the following return values in the **Autos** window:
199202

200203
::: moniker range=">= vs-2022"
201-
![Screenshot of Autos return value C#.](../debugger/media/vs-2022/autos-return-value-csharp-2.png "Autos return value C#")
204+
[ ![Screenshot of Autos return value C#.](../debugger/media/vs-2022/autos-return-value-csharp-2.png "Autos return value C#") ](../debugger/media/vs-2022/autos-return-value-csharp-2.png#lightbox)
202205
::: moniker-end
203206
::: moniker range="vs-2019"
204207
![Screenshot of Autos return value C#.](../debugger/media/autosreturnvaluecsharp2.png "Autos return value C#")

docs/debugger/debugger-feature-tour.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: "First look at the debugger"
33
description: Get started debugging your applications by using the Visual Studio debugger and see what your code is doing while it runs.
44
ms.topic: conceptual
5-
ms.date: 09/20/2024
5+
ms.date: 11/5/2024
66
helpviewer_keywords:
77
- "debugger"
88
author: mikejo5000
@@ -181,6 +181,17 @@ Next, look at the **Locals** window. The **Locals** window shows you the variabl
181181

182182
In this example, the `this` object and the object `f` are in scope. For more info, see [Inspect Variables in the Autos and Locals Windows](../debugger/autos-and-locals-windows.md).
183183

184+
::: moniker range=">= vs-2022"
185+
## View return values of method calls
186+
187+
In .NET and C++ code, you can examine return values in the **Autos** window when you step over or out of a method call, which can be useful when the return value is not stored in a local variable. For more information, see [View return values of method calls](../debugger/autos-and-locals-windows.md#bkmk_returnValue).
188+
189+
Starting in Visual Studio 2022 version 17.12 Preview 3, you can also view return values of method calls inline and not just in the Autos window.
190+
191+
[ ![Screenshot showing the return values of method calls.](../debugger/media/vs-2022/view-return-values.png) ](../debugger/media/vs-2022/view-return-values.png#lightbox)
192+
193+
::: moniker-end
194+
184195
## Set a watch
185196

186197
You can use a **Watch** window to specify a variable (or an expression) that you want to keep an eye on. For detailed information, see [Set a Watch using the Watch and QuickWatch Windows](../debugger/watch-and-quickwatch-windows.md).
Loading
Loading

0 commit comments

Comments
 (0)