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/get-started/tutorial-console-cpp.md
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -141,9 +141,9 @@ It's time to add some math logic.
141
141
142
142

143
143
144
-
You should now have three tabs open in the editor: *`CalculatorTutorial.cpp`*, *Calculator.h*, and *`Calculator.cpp`*. If you accidentally close one of them, you can reopen it by double-clicking it in the **Solution Explorer** window.
144
+
You should now have three tabs open in the editor: *`CalculatorTutorial.cpp`*, *`Calculator.h`*, and *`Calculator.cpp`*. If you accidentally close one of them, you can reopen it by double-clicking it in the **Solution Explorer** window.
145
145
146
-
1. In **Calculator.h**, remove the `Calculator();` and `~Calculator();` lines that were generated, since you won't need them here. Next, add the following line of code so the file now looks like this:
146
+
1. In **`Calculator.h`**, remove the `Calculator();` and `~Calculator();` lines that were generated, since you won't need them here. Next, add the following line of code so the file now looks like this:
147
147
148
148
```cpp
149
149
#pragma once
@@ -167,7 +167,7 @@ It's time to add some math logic.
167
167
168
168
A pop-up appears that gives you a peek of the code change that was made in the other file. The code was added to *`Calculator.cpp`*.
169
169
170
-

170
+

171
171
172
172
Currently, it just returns 0.0. Let's change that. Press **Esc** to close the pop-up.
173
173
@@ -267,7 +267,7 @@ Since the user is free to type anything into the console window, let's make sure
267
267
268
268
1. Set a breakpoint on the `result = c.Calculate(x, oper, y);` line, just after the user was asked for input. To set the breakpoint, click next to the line in the gray vertical bar along the left edge of the editor window. A red dot appears.
269
269
270
-

270
+

271
271
272
272
Now when we debug the program, it always pauses execution at that line. We already have a rough idea that the program works for simple cases. Since we don't want to pause execution every time, let's make the breakpoint conditional.
273
273
@@ -289,7 +289,7 @@ Whenever you debug your code, you may notice that some new windows appear. These
289
289
290
290
You can also just hover over variables in the code itself to see their current values where the execution is currently paused. Make sure the editor window is in focus by clicking on it first.
291
291
292
-

292
+

293
293
294
294
### To continue debugging
295
295
@@ -438,7 +438,7 @@ The template for a new windows console application creates a simple C++ "Hello W
438
438
439
439
1. To run the code, on the menu bar, choose **Debug**, **Start without debugging**.
440
440
441
-

441
+

442
442
443
443
A console window opens and then runs your app. When you start a console app in Visual Studio, it runs your code, then prints "Press any key to continue . . ." to give you a chance to see the output. Congratulations! You've created your first "Hello, world!" console app in Visual Studio!
444
444
@@ -494,7 +494,7 @@ Now let's turn the code in this template into a calculator app.
494
494
1. To run the application, press **Ctrl+F5** or go to the **Debug** menu and choose **Start Without Debugging**. If you get a pop-up that says **This project is out of date**, you may select **Do not show this dialog again**, and then choose **Yes** to build your application. You should see a console window appear that displays the text specified in the code.
495
495
496
496
:::image type="complex" source="./media/calculator-first-launch.gif" alt-text="Short video of running the calculator app.":::
497
-
Short video showing Debug > Start without debugging. A dialog asks whether to build because the project is out of date. The checkbox for Do not show this dialog again is selected. Yes is selected to build the project, the calculator project builds, and then launches in a Windows console window.
497
+
Short video showing Debug > Start without debugging. A dialog is visible that asks whether to build because the project is out of date. The checkbox for 'Do not show this dialog again' is selected. 'Yes' is selected to build the project, the calculator project builds, and then launches in a Windows console window.
498
498
:::image-end:::
499
499
500
500
1. Close the console window when you're done.
@@ -513,9 +513,9 @@ It's time to add some math logic.
513
513
514
514

515
515
516
-
You should now have three tabs open in the editor: *`CalculatorTutorial.cpp`*, *Calculator.h*, and *`Calculator.cpp`*. If you accidentally close one of them, you can reopen it by double-clicking it in the **Solution Explorer** window.
516
+
You should now have three tabs open in the editor: *`CalculatorTutorial.cpp`*, *`Calculator.h`*, and *`Calculator.cpp`*. If you accidentally close one of them, you can reopen it by double-clicking it in the **Solution Explorer** window.
517
517
518
-
1. In **Calculator.h**, remove the `Calculator();` and `~Calculator();` lines that were generated, since you won't need them here. Next, add the following line of code so the file now looks like this:
518
+
1. In **`Calculator.h`**, remove the `Calculator();` and `~Calculator();` lines that were generated, since you won't need them here. Next, add the following line of code so the file now looks like this:
519
519
520
520
```cpp
521
521
#pragma once
@@ -637,21 +637,21 @@ Since the user is free to type anything into the console window, let's make sure
637
637
638
638
1. Set a breakpoint on the `result = c.Calculate(x, oper, y);` line, just after the user was asked for input. To set the breakpoint, click next to the line in the gray vertical bar along the left edge of the editor window. A red dot appears.
639
639
640
-

640
+

641
641
642
642
Now when we debug the program, it always pauses execution at that line. We already have a rough idea that the program works for simple cases. Since we don't want to pause execution every time, let's make the breakpoint conditional.
643
643
644
644
1. Right-click the red dot that represents the breakpoint, and choose **Conditions**. In the edit box for the condition, enter `(y == 0) && (oper == '/')`. Choose the **Close** button when you're done. The condition is saved automatically.
645
645
646
646
:::image type="complex" source="./media/calculator-conditional-breakpoint.gif" alt-text="Set a conditional breakpoint":::
647
-
Short video showing a right-click on the breakpointon the line of code that reads result = c dot Calculate ( x, oper, y). Conditions... is selected in the dropdown which opens the breakpoint settings window. In the text box following the Conditional Expression and Is true dropdowns, the user enters y==0 && oper == '/', and then selects close to set the conditional breakpoint.
647
+
Short video showing a right-click on the breakpoint. The breakpoint is on the line of code that reads result = c dot Calculate ( x, oper, y). 'Conditions...' is selected in the dropdown which opens the breakpoint settings window. In the text box following the Conditional Expression and Is true dropdowns, the user enters y == 0 && oper == '/', and then selects close to set the conditional breakpoint.
648
648
:::image-end:::
649
649
650
650
Now we pause execution at the breakpoint specifically if a division by 0 is attempted.
651
651
652
652
1. To debug the program, press **F5**, or choose the **Local Windows Debugger** toolbar button that has the green arrow icon. In your console app, if you enter something like "5 - 0", the program behaves normally and keeps running. However, if you type "10 / 0", it pauses at the breakpoint. You can even put any number of spaces between the operator and numbers; `cin` is smart enough to parse the input appropriately.
653
653
654
-

654
+

655
655
656
656
### Useful windows in the debugger
657
657
@@ -661,11 +661,11 @@ Whenever you debug your code, you may notice that some new windows appear. These
661
661
662
662
To see all of the variables from that function, switch to the **Locals** window. You can actually modify the values of these variables while debugging, to see what effect they would have on the program. In this case, we'll leave them alone.
663
663
664
-

664
+

665
665
666
666
You can also just hover over variables in the code itself to see their current values where the execution is currently paused. Make sure the editor window is in focus by clicking on it first.
667
667
668
-

668
+

Copy file name to clipboardExpand all lines: docs/linux/cmake-linux-configure.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -129,7 +129,7 @@ To target WSL, select **Manage Configurations** in the configuration dropdown in
129
129
130
130
The **CMakeSettings.json** window appears.
131
131
132
-

132
+

133
133
134
134
Press **Add Configuration** (the green '+' button) and then choose **Linux-GCC-Debug** or **Linux-GCC-Release** if using GCC. Use the Clang variants if you're using the Clang/LLVM toolset. Press **Select** and then **Ctrl+S** to save the configuration.
Copy file name to clipboardExpand all lines: docs/linux/connect-to-your-remote-linux-computer.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,7 @@ If `ssh` isn't already set up and running on your Linux system, follow these ste
64
64
65
65
1. In the Connection Manager dialog, choose the **Add** button to add a new connection.
66
66
67
-

67
+

68
68
69
69
In either scenario, the **Connect to Remote System** window is displayed.
70
70
@@ -203,7 +203,7 @@ The `rsync` command is used by both MSBuild-based Linux projects and CMake proje
203
203
204
204
`rsync` is also used by Visual Studio's CMake support to copy source files to the remote system. If you can't enable TCP port forwarding, you can use `sftp` as your remote copy sources method. `sftp` is often slower than `rsync`, but doesn't have a dependency on TCP port forwarding. You can manage your remote copy sources method with the `remoteCopySourcesMethod` property in the [CMake Settings Editor](../build/cmakesettings-reference.md#settings-for-cmake-linux). If TCP port forwarding is disabled on your remote system, you'll see an error in the CMake output window the first time it invokes `rsync`.
205
205
206
-

206
+

207
207
208
208
`gdbserver` can be used for debugging on embedded devices. If you can't enable TCP port forwarding, then you must use `gdb` for all remote debugging scenarios. `gdb` is used by default when debugging projects on a remote system.
@@ -125,13 +125,13 @@ You can separate your remote build machine from your remote debug machine for bo
125
125
126
126
By default, the remote debug machine is the same as the remote build machine (**Configuration Properties** > **General** > **Remote Build Machine**). To specify a new remote debug machine, right-click on the project in **Solution Explorer** and go to **Configuration Properties** > **Debugging** > **Remote Debug Machine**.
127
127
128
-

128
+

129
129
130
130
The drop-down menu for **Remote Debug Machine** is populated with all established remote connections. To add a new remote connection, navigate to **Tools** > **Options** > **Cross Platform** > **Connection Manager** or search for "Connection Manager" in **Quick Launch**. You can also specify a new remote deploy directory in the project's Property Pages (**Configuration Properties** > **General** > **Remote Deploy Directory**).
131
131
132
132
By default, only the files necessary for the process to debug will be deployed to the remote debug machine. You can use **Solution Explorer** to configure which source files will be deployed to the remote debug machine. When you click on a source file, you'll see a preview of its File Properties directly below the Solution Explorer.
133
133
134
-

134
+

135
135
136
136
The **Content** property specifies whether the file will be deployed to the remote debug machine. You can disable deployment entirely by navigating to **Property Pages** > **Configuration Manager** and unchecking **Deploy** for the desired configuration.
137
137
@@ -158,7 +158,7 @@ In some cases, you may require more control over your project's deployment. For
158
158
159
159
For CMake projects that target a remote Linux machine, you can specify a new remote debug machine in launch.vs.json. By default, the value of "remoteMachineName" is synchronized with the "remoteMachineName" property in CMakeSettings.json, which corresponds to your remote build machine. These properties no longer need to match, and the value of "remoteMachineName" in launch.vs.json will dictate which remote machine is used for deploy and debug.
160
160
161
-

161
+

162
162
163
163
IntelliSense will suggest all a list of all established remote connections. You can add a new remote connection by navigating to **Tools** > **Options** > **Cross Platform** > **Connection Manager** or searching for "Connection Manager" in **Quick Launch**.
Copy file name to clipboardExpand all lines: docs/linux/download-install-and-setup-the-linux-development-workload.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -28,7 +28,7 @@ For any of these scenarios, the **Linux development with C++** workload is requi
28
28
29
29
1. Type "Visual Studio Installer" in the Windows search box:
30
30
31
-

31
+

32
32
33
33
1. Look for the installer under the **Apps** results and double-click it. When the installer opens, choose **Modify**, and then click on the **Workloads** tab. Scroll down to **Other toolsets** and select the **Linux development with C++** workload.
Copy file name to clipboardExpand all lines: docs/linux/linux-asan-configuration.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -31,11 +31,11 @@ You can also view the full ASan output (including where the corrupted memory was
31
31
32
32
To enable ASan for MSBuild-based Linux projects, right-click on the project in **Solution Explorer** and select **Properties**. Next, navigate to **Configuration Properties** > **C/C++** > **Sanitizers**. ASan is enabled via compiler and linker flags, and requires your project to be recompiled to work.
33
33
34
-

34
+

35
35
36
36
You can pass optional ASan runtime flags by navigating to **Configuration Properties** > **Debugging** > **AddressSanitizer Runtime Flags**. Click the down-arrow to add or remove flags.
37
37
38
-

38
+

39
39
40
40
## Enable ASan for Visual Studio CMake projects
41
41
@@ -46,7 +46,7 @@ To enable ASan for CMake, right-click on the `CMakeLists.txt` file in **Solution
46
46
47
47
Make sure you have a Linux configuration (for example, **Linux-Debug**) selected in the left pane of the dialog:
48
48
49
-

49
+

50
50
51
51
The ASan options are under **General**. Enter the ASan runtime flags in the format "flag=value", separated by spaces. The UI incorrectly suggests using semi-colons. Use spaces or colons to separate flags.
0 commit comments