Skip to content

Commit f514c64

Browse files
author
Greg Van Liew
authored
Merge branch 'master' into live
2 parents 6cd7e5f + d7f9b3e commit f514c64

File tree

2,026 files changed

+85649
-8508
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,026 files changed

+85649
-8508
lines changed

TOC.md

Lines changed: 0 additions & 7769 deletions
This file was deleted.

docs/data-tools/TOC.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
### [Create and configure datasets in Visual Studio](create-and-configure-datasets-in-visual-studio.md)
1717
#### [Typed vs. untyped datasets](typed-vs-untyped-datasets.md)
1818
#### [Relationships in datasets](relationships-in-datasets.md)
19-
#### [Walkthrough: Creating a DataSet in the Dataset Designer](walkthrough-creating-a-dataset-in-the-dataset-designer.md)
19+
#### [Walkthrough: Creating a DataSet with the Dataset Designer](walkthrough-creating-a-dataset-with-the-dataset-designer.md)
2020
#### [Walkthrough: Creating a DataTable in the Dataset Designer](walkthrough-creating-a-datatable-in-the-dataset-designer.md)
2121
### [Fill datasets by using TableAdapters](fill-datasets-by-using-tableadapters.md)
2222
#### [Create and configure TableAdapters](create-and-configure-tableadapters.md)

docs/debugger/addmessage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Adds a custom message to the graphics diagnostics *HUD* (Head-Up Display).
3434

3535
## Syntax
3636

37-
```cpp
37+
```C++
3838
void AddMessage(
3939
wchar_t const * szMessage
4040
);

docs/debugger/assertions-in-managed-code.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ An assertion, or `Assert` statement, tests a condition, which you specify as an
7373
## <a name="BKMK_The_Debug_Assert_method"></a> The Debug.Assert method
7474
Use the <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> method freely to test conditions that should hold true if your code is correct. For example, suppose you have written an integer divide function. By the rules of mathematics, the divisor can never be zero. You might test this using an assertion:
7575

76-
```vb
76+
```VB
7777
Function IntegerDivide(ByVal dividend As Integer, ByVal divisor As Integer) As Integer
7878
Debug.Assert(divisor <> 0)
7979
Return CInt(dividend / divisor)
8080
End Function
8181
```
8282

83-
```c#
83+
```CSharp
8484
int IntegerDivide ( int dividend , int divisor )
8585
{ Debug.Assert ( divisor != 0 );
8686
return ( dividend / divisor ); }
@@ -90,29 +90,29 @@ int IntegerDivide ( int dividend , int divisor )
9090

9191
Here is another example. You have a class that implements a checking account, as follows:
9292

93-
```vb
93+
```VB
9494
Dim amount, balance As Double
9595
balance = savingsAccount.balance
9696
Debug.Assert(amount <= balance)
9797
SavingsAccount.Withdraw(amount)
9898
```
9999

100-
```c#
100+
```CSharp
101101
float balance = savingsAccount.Balance;
102102
Debug.Assert ( amount <= balance );
103103
savingsAccount.Withdraw ( amount );
104104
```
105105

106106
Before you withdraw money from the account, you want to make sure that the account balance is sufficient to cover the amount you are preparing to withdraw. You might write an assertion to check the balance:
107107

108-
```vb
108+
```VB
109109
Dim amount, balance As Double
110110
balance = savingsAccount.balance
111111
Trace.Assert(amount <= balance)
112112
SavingsAccount.Withdraw(amount)
113113
```
114114

115-
```c#
115+
```CSharp
116116
float balance = savingsAccount.Balance;
117117
Trace.Assert ( amount <= balance );
118118
savingsAccount.Withdraw ( amount );
@@ -127,24 +127,24 @@ savingsAccount.Withdraw ( amount );
127127
## <a name="BKMK_Side_effects_of_Debug_Assert"></a> Side effects of Debug.Assert
128128
When you use <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName>, make sure that any code inside `Assert` does not change the results of the program if `Assert` is removed. Otherwise, you might accidentally introduce a bug that only shows up in the Release version of your program. Be especially careful about asserts that contain function or procedure calls, such as the following example:
129129

130-
```vb
130+
```VB
131131
' unsafe code
132132
Debug.Assert (meas(i) <> 0 )
133133
```
134134

135-
```c#
135+
```CSharp
136136
// unsafe code
137137
Debug.Assert (meas(i) != 0 );
138138
```
139139

140140
This use of <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> might appear safe at first glance, but suppose the function meas updates a counter each time it is called. When you build the Release version, this call to meas is eliminated, so the counter does not get updated. This is an example of a function with a side effect. Eliminating a call to a function that has side effects could result in a bug that only appears in the Release version. To avoid such problems, do not place function calls in a <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> statement. Use a temporary variable instead:
141141

142-
```vb
142+
```VB
143143
temp = meas( i )
144144
Debug.Assert (temp <> 0)
145145
```
146146

147-
```c#
147+
```CSharp
148148
temp = meas( i );
149149
Debug.Assert ( temp != 0 );
150150
```
@@ -175,37 +175,37 @@ Debug.Assert ( temp != 0 );
175175
## <a name="BKMK_Assert_arguments"></a> Assert arguments
176176
<xref:System.Diagnostics.Trace.Assert%2A?displayProperty=fullName> and <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> take up to three arguments. The first argument, which is mandatory, is the condition you want to check. If you call <xref:System.Diagnostics.Trace.Assert(System.Boolean)?displayProperty=fullName> or <xref:System.Diagnostics.Debug.Assert(System.Boolean)?displayProperty=fullName> with only one argument, the `Assert` method checks the condition and, if the result is false, outputs the contents of the call stack to the **Output** window. The following example shows <xref:System.Diagnostics.Trace.Assert(System.Boolean)?displayProperty=fullName> and <xref:System.Diagnostics.Debug.Assert(System.Boolean)?displayProperty=fullName>:
177177

178-
```vb
178+
```VB
179179
Debug.Assert(stacksize > 0)
180180
Trace.Assert(stacksize > 0)
181181
```
182182

183-
```c#
183+
```CSharp
184184
Debug.Assert ( stacksize > 0 );
185185
Trace.Assert ( stacksize > 0 );
186186
```
187187

188188
The second and third arguments, if present, must be strings. If you call <xref:System.Diagnostics.Trace.Assert%2A?displayProperty=fullName> or <xref:System.Diagnostics.Debug.Assert%2A?displayProperty=fullName> with two or three arguments, the first argument is a condition. The method checks the condition and, if the result is false, outputs the second string and third strings. The following example shows <xref:System.Diagnostics.Debug.Assert(System.Boolean,System.String)?displayProperty=fullName> and <xref:System.Diagnostics.Trace.Assert(System.Boolean,System.String)?displayProperty=fullName> used with two arguments:
189189

190-
```vb
190+
```VB
191191
Debug.Assert(stacksize > 0, "Out of stack space")
192192
Trace.Assert(stacksize > 0, "Out of stack space")
193193
```
194194

195-
```c#
195+
```CSharp
196196
Debug.Assert ( stacksize > 0, "Out of stack space" );
197197
Trace.Assert ( stacksize > 0, "Out of stack space" );
198198
```
199199

200200
The following example shows <xref:System.Diagnostics.Debug.Assert%2A> and <xref:System.Diagnostics.Trace.Assert%2A>:
201201

202-
```vb
202+
```VB
203203
Debug.Assert(stacksize > 0, "Out of stack space. Bytes left:" , Format(size, "G"))
204204
Trace.Assert(stacksize > 0, "Out of stack space. Bytes left:" , Format(size, "G"))
205205
Trace.Assert(stacksize > 0, "Out of stack space. Bytes left:", "inctemp failed on third call" )
206206
```
207207

208-
```c#
208+
```CSharp
209209
Debug.Assert ( stacksize > 100, "Out of stack space" , "Failed in inctemp" );
210210
Trace.Assert ( stacksize > 0, "Out of stack space", "Failed in inctemp" );
211211
```
Lines changed: 48 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Inspect Variables in the Debugger | Microsoft Docs"
33
ms.custom: ""
4-
ms.date: "11/04/2016"
4+
ms.date: "02/07/2017"
55
ms.reviewer: ""
66
ms.suite: ""
77
ms.technology:
@@ -11,12 +11,6 @@ ms.topic: "hero-article"
1111
f1_keywords:
1212
- "vs.debug.autos"
1313
- "vs.debug.locals"
14-
dev_langs:
15-
- "FSharp"
16-
- "VB"
17-
- "CSharp"
18-
- "C++"
19-
- "JScript"
2014
helpviewer_keywords:
2115
- "debugger, variable windows"
2216
- "debugging [Visual Studio], variable windows"
@@ -44,49 +38,49 @@ translation.priority.mt:
4438
# Inspecting Variables in the Autos and Locals Windows
4539
The **Autos** window (while debugging, **CTRL+ALT+V, A**, or **Debug / Windows / Autos**) and the **Locals** window (while debugging, **CTRL+ALT+V, L**, or **Debug / Windows / Locals**) are quite useful when you want to see variable values while you are debugging. The **Locals** window displays variables that are defined in the local scope, which is generally the function or method that is currently being executed. The **Autos** window displays variables used around the current line (the place where the debugger is stopped). Exactly which variables displayed is different in different languages. See What variables appear in the Autos Window? below.
4640

47-
If you need more information about basic debugging, see [Getting Started with the Debugger](../debugger/getting-started-with-the-debugger.md).
41+
If you need more information about basic debugging, see [Getting Started with the Debugger](../debugger/getting-started-with-the-debugger.md).
4842

4943
## Looking at objects in the Autos and Locals windows
50-
Arrays and objects are displayed in the Autos and Locals windows as tree controls. Click on the arrow to the left of the variable name to expand the view to show fields and properties. Here is an example of a [FileStream](http://msdn.microsoft.com/Library/a8737776-e545-4867-91ed-51c7f031fa19) object in the **Locals** window:
44+
Arrays and objects are displayed in the Autos and Locals windows as tree controls. Click on the arrow to the left of the variable name to expand the view to show fields and properties. Here is an example of a [FileStream](http://msdn.microsoft.com/Library/a8737776-e545-4867-91ed-51c7f031fa19) object in the **Locals** window:
5145

52-
![Locals&#45;FileStream](../debugger/media/locals-filestream.png "Locals-FileStream")
46+
![Locals&#45;FileStream](../debugger/media/locals-filestream.png "Locals-FileStream")
5347

5448
## What variables appear in the Autos window?
5549
You can use the **Autos** window in C#, Visual Basic, and C++ code. The **Autos** window does not support JavaScript or F#.
5650

57-
In C# and Visual Basic, the **Autos** window displays any variable used on the current or preceding line. For example, if you declare four variables and set them as follows:
58-
59-
```c#
60-
public static void Main()
61-
{
62-
int a, b, c, d;
63-
a = 1;
64-
b = 2;
65-
c = 3;
66-
d = 4;
67-
}
68-
```
69-
51+
In C# and Visual Basic, the **Autos** window displays any variable used on the current or preceding line. For example, if you declare four variables and set them as follows:
52+
53+
```CSharp
54+
public static void Main()
55+
{
56+
int a, b, c, d;
57+
a = 1;
58+
b = 2;
59+
c = 3;
60+
d = 4;
61+
}
62+
```
63+
7064
If you set a breakpoint on the line `c = 3`; and run the debugger, when execution stops the **Autos** window will look like this:
71-
65+
7266
![Autos&#45;CSharp](../debugger/media/autos-csharp.png "Autos-CSharp")
73-
67+
7468
Note that the value of `c` is 0, because the line `c = 3` has not yet been executed.
75-
76-
In C++ the **Autos** window displays the variables used at least three lines before the current line (the line at which execution is stopped). If you declare six variables:
77-
78-
```cpp
79-
void main() {
80-
int a, b, c, d, e, f;
81-
a = 1;
82-
b = 2;
83-
c = 3;
84-
d = 4;
85-
e = 5;
86-
f = 6;
87-
}
88-
```
89-
69+
70+
In C++ the **Autos** window displays the variables used at least three lines before the current line (the line at which execution is stopped). If you declare six variables:
71+
72+
```C++
73+
void main() {
74+
int a, b, c, d, e, f;
75+
a = 1;
76+
b = 2;
77+
c = 3;
78+
d = 4;
79+
e = 5;
80+
f = 6;
81+
}
82+
```
83+
9084
If you set a breakpoint on the line `e = 5;` and run the debugger, when execution stops the **Autos** window will look like this:
9185
9286
![Autos&#45;Cplus](../debugger/media/autos-cplus.png "Autos-Cplus")
@@ -99,8 +93,8 @@ void main() {
9993
In .NET and C++ code you can examine return values when you step over or out of a method call. This functionality is useful when the result of a method call is not stored in a local variable, for example when a method is used as a parameter or as a return value of another method.
10094
10195
The following C# code adds the return values of two functions:
102-
103-
```c#
96+
97+
```CSharp
10498
static void Main(string[] args)
10599
{
106100
int a, b, c, d;
@@ -120,29 +114,28 @@ private static int subtractVars(int i, int j)
120114
{
121115
return j - i;
122116
}
123-
124-
```
125-
117+
```
118+
126119
Set a breakpoint on the int `x = sumVars(a, b) + subtractVars(c, d);` line.
127120

128121
Start debugging, and when execution breaks at the first breakpoint, press **F10 (Step Over)**. You should see the following in the **Autos** window:
129122

130123
![AutosReturnValueCSharp2](../debugger/media/autosreturnvaluecsharp2.png "AutosReturnValueCSharp2")
131124

132125
## Why are variable values sometimes red in Locals and Autos windows?
133-
You may notice that the value of a variable is sometimes red in the **Locals** and **Autos** windows. These are variable values that have been changed since the last evaluation. The change could be from a previous debugging session, or because the value was changed in the window.
126+
You may notice that the value of a variable is sometimes red in the **Locals** and **Autos** windows. These are variable values that have been changed since the last evaluation. The change could be from a previous debugging session, or because the value was changed in the window.
134127

135128
## Changing the numeric format of a variable window
136-
The default numeric format is decimal, but you can change it to hexadecimal. Right-click inside a **Locals** or **Autos** window and select **Hexadecimal Display**. The change affects all debugger windows.
129+
The default numeric format is decimal, but you can change it to hexadecimal. Right-click inside a **Locals** or **Autos** window and select **Hexadecimal Display**. The change affects all debugger windows.
137130

138131
## Editing a Value in a Variable Window
139-
You can edit the values of most variables that appear in the **Autos**, **Locals**, **Watch**, and **QuickWatch** windows. For information about **Watch** and **QuickWatch** windows, see [Watch and QuickWatch Windows](../debugger/watch-and-quickwatch-windows.md). Just double-click the value you want to change and add the new the value.
140-
141-
You can enter an expression for a value, for example `a + b`. The debugger accepts most valid language expressions.
132+
You can edit the values of most variables that appear in the **Autos**, **Locals**, **Watch**, and **QuickWatch** windows. For information about **Watch** and **QuickWatch** windows, see [Watch and QuickWatch Windows](../debugger/watch-and-quickwatch-windows.md). Just double-click the value you want to change and add the new the value.
142133

143-
In native C++ code, you might have to qualify the context of a variable name. For more information, see [Context Operator (C++)](../debugger/context-operator-cpp.md).
134+
You can enter an expression for a value, for example `a + b`. The debugger accepts most valid language expressions.
144135

145-
However, you should exercise caution when changing values. Here are some possible issues:
136+
In native C++ code, you might have to qualify the context of a variable name. For more information, see [Context Operator (C++)](../debugger/context-operator-cpp.md).
137+
138+
However, you should exercise caution when changing values. Here are some possible issues:
146139

147140
- Evaluating some expressions can change the value of a variable or otherwise affect the state of your program. For example, evaluating `var1 = ++var2` changes the value of `var1` and `var2`.
148141

@@ -151,11 +144,11 @@ private static int subtractVars(int i, int j)
151144
- Editing floating-point values can result in minor inaccuracies because of decimal-to-binary conversion of fractional components. Even a seemingly harmless edit can result in changes to some of the least significant bits in the floating-point variable.
152145

153146
## Debug Location toolbar
154-
You can use the **Debug Location** toolbar to select the desired function, thread, or process. Set a breakpoint and start debugging. (If you do not see this toolbar, you can enable it by clicking in an empty part of the toolbar area. You should see a list of toolbars; select **Debug Location**). When the breakpoint is hit, execution stops and you can see the Debug Location toolbar, which is the bottom row of the following graphic:
147+
You can use the **Debug Location** toolbar to select the desired function, thread, or process. Set a breakpoint and start debugging. (If you do not see this toolbar, you can enable it by clicking in an empty part of the toolbar area. You should see a list of toolbars; select **Debug Location**). When the breakpoint is hit, execution stops and you can see the Debug Location toolbar, which is the bottom row of the following graphic:
155148

156-
![DebugLocationToolbar](../debugger/media/debuglocationtoolbar.png "DebugLocationToolbar")
149+
![DebugLocationToolbar](../debugger/media/debuglocationtoolbar.png "DebugLocationToolbar")
157150

158-
You can also change the context to different function calls, threads, or processes by double-clicking the element in the **Call Stack** window, the **Threads** window, or the **Processes** window.
151+
You can also change the context to different function calls, threads, or processes by double-clicking the element in the **Call Stack** window, the **Threads** window, or the **Processes** window.
159152

160153
## See Also
161154
[Debugger Windows](../debugger/debugger-windows.md)

docs/debugger/begincapture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Begins a capture interval that will end with `EndCapture`.
3434

3535
## Syntax
3636

37-
```cpp
37+
```C++
3838
void BeginCapture();
3939
```
4040

docs/debugger/capturecurrentframe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Captures the remainder of the current frame to the graphics log file.
3434

3535
## Syntax
3636

37-
```cpp
37+
```C++
3838
void CaptureCurrentFrame();
3939
```
4040

docs/debugger/context-operator-cpp.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,21 +55,21 @@ You can use the context operator in C++ to qualify a breakpoint location, variab
5555

5656
For example, to set a breakpoint at the `SomeFunction` function of EXAMPLE.dll:
5757

58-
```cpp
58+
```C++
5959
{,,EXAMPLE.dll}SomeFunction
6060
```
6161

6262
2. *module*!*expression*
6363

64-
```cpp
64+
```C++
6565
EXAMPLE.dll!SomeFunction
6666
```
6767

6868
- *module* is the name of a module. You can use a full path to disambiguate between modules with the same name.
6969

7070
If the *module* path includes a comma, an embedded space, or a brace, you must use quotation marks around the path so that the context parser can properly recognize the string. Single quotation marks are considered part of a Windows file name, so you must use double quotation marks. For example,
7171

72-
```cpp
72+
```C++
7373
{,,"a long, long, library name.dll"} g_Var
7474
```
7575

docs/debugger/copy-programmatic-capture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Copies the contents of the active graphics log (.vsglog) file into a new file.
3434

3535
## Syntax
3636

37-
```cpp
37+
```C++
3838
void Copy(
3939
wchar_t const * szNewVSGLog
4040
);

docs/debugger/debug-interface-access/basictype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Specifies the symbol's basic type.
3838

3939
## Syntax
4040

41-
```cpp#
41+
```C++
4242
enum BasicType { 
4343
   btNoType = 0,
4444
   btVoid = 1,

docs/debugger/debug-interface-access/constants-debug-interface-access-sdk.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ These string constants can be used to identify various sections of a program deb
5454
## Example
5555
Here is an example using one of these symbols:
5656

57-
```cpp#
57+
```C++
5858
HRESULT GetSymbolTable(IDiaEnumTables *pEnumTables, IDiaTable **pTable)
5959
{
6060
    HRESULT hr;

docs/debugger/debug-interface-access/cv-access-e.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Specifies the scope of visibility (access level) of member functions and variabl
3838

3939
## Syntax
4040

41-
```cpp#
41+
```C++
4242
typedef enum CV_access_e { 
4343
   CV_private = 1,
4444
   CV_protected = 2,

0 commit comments

Comments
 (0)