Skip to content

Commit 76edb90

Browse files
TylerMSFTTylerMSFT
authored andcommitted
cleanup pass
1 parent 19401b2 commit 76edb90

File tree

3 files changed

+28
-23
lines changed

3 files changed

+28
-23
lines changed

docs/build/cmake-remote-debugging.md

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Tutorial: Debug a CMake project on a remote Windows machine"
3-
ms.date: "12/2/2020"
3+
ms.date: "12/4/2020"
44
ms.topic: tutorial
55
description: "How to use Visual Studio C++ on Windows to create and build a CMake project. You'll then deploy and debug it on a remote Windows machine."
66
---
@@ -24,51 +24,55 @@ In this tutorial, you'll learn how to:
2424

2525
### On the host machine
2626

27-
To set up Visual Studio for cross-platform C++ development, install the build tools for the target architecture. For this tutorial, install the ARM64 build tools by following these steps:
27+
To set up Visual Studio for cross-platform C++ development, install the build tools for the target architecture. For this tutorial, install the ARM64 build tools by doing the following:
2828

2929
1. Run the Visual Studio Installer. If you haven't installed Visual Studio yet, see [Install Visual Studio](https://docs.microsoft.com/visualstudio/install/install-visual-studio#:~:text=Install%20Visual%20Studio%201%20Make%20sure%20your%20computer,...%204%20Choose%20workloads.%20...%20More%20items...%20)
30-
1. On the Visual Studio Installer home screen, choose **Modify** (look under **More** if you don't see it).
30+
1. On the Visual Studio Installer home screen, choose **Modify**.
3131
1. From the choices at the top, choose **Individual components**.
3232
1. Scroll down to the **Compilers, build tools, and runtimes** section.
3333
1. Ensure that the following are selected:
3434
- **C++ CMake tools for Windows**
35-
- **MSVC v142 - VS 2019 C++ ARM64 build tools (v14.28)** (choose the latest version)
35+
- **MSVC v142 - VS 2019 C++ ARM64 build tools (Latest)** It's important that you choose the `ARM64` build tools and not the `ARM` build tools (look for the 64) and that you choose the version that goes with `VS 2019`.
3636
1. Select **Modify** to install the tools.
3737

3838
### On the remote machine
3939

40-
1. Install the remote tools on the remote machine. For this tutorial, install the ARM64 tools as described in [Download and Install the remote tools](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#download-and-install-the-remote-tools).
41-
1. Install a remote debugger on the remote machine. For this tutorial, follow the directions in [set up the remote debugger](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#BKMK_setup) on the remote Windows machine.
40+
1. Install the remote tools on the remote machine. For this tutorial, install the ARM64 tools by following the instructions in [Download and Install the remote tools](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#download-and-install-the-remote-tools).
41+
1. Start and configure the remote debugger on the remote machine. For this tutorial, do so by following the directions in [set up the remote debugger](https://docs.microsoft.com/visualstudio/debugger/remote-debugging-cpp?%23download-and-install-the-remote-tools#BKMK_setup) on the remote Windows machine.
4242

4343
## Create a CMake project
4444

4545
On the Windows host machine:
4646
1. Run Visual Studio
47-
1. From the main menu, select **Create new project** > **CMake Project** > **Next**
47+
1. From the main menu, select **File** > **New** > **Project**.
48+
1. Select **CMake Project** > **Next**
4849
1. Give the project a name and choose a location. Then select **Create**.
4950

5051
Give Visual Studio a few moments to create the project and populate the **Solution Explorer**.
5152

5253
## Change the configuration to target ARM64
5354

54-
To target an ARM64 Windows machine, you need to build with ARM64 build tools. Select the Visual Studio **Configuration** dropdown and select **Manage Configurations...**
55+
To target an ARM64 Windows machine, you need to build using ARM64 build tools.
56+
57+
Select the Visual Studio **Configuration** dropdown and select **Manage Configurations**.
5558

5659
![Choose Manage Configurations in the Visual Studio configurations drop-down](media/vs2019-cmake-manage-configurations.png)
5760

58-
Add a new configuration by selecting the green **+** button. Choose **arm64-debug** in the dialog that appears and press the **Select** button:
61+
Add a new configuration by selecting **Add a new configuration** (the green **+** button).\
62+
In the **CMakeSettings** dialog that appears, select **arm64-debug**, and then press **Select**:
5963

6064
![Add arm64-debug configuration](media/cmake-add-config-icon-with-target-dialog.png)
6165

62-
This will add a debug configuration named **arm64-Debug** to the *`CmakeSettings.json`* file. This configuration name is a unique, friendly name to make it easier for you to identify these settings in the **Configuration** dropdown.
66+
This adds a debug configuration named **arm64-Debug** to your *`CmakeSettings.json`* file. This configuration name is a unique, friendly name that makes it easier for you to identify these settings in the **Configuration** dropdown.
6367

6468
The **Toolset** dropdown will be set to **msvc_arm64_x64**. Your settings should now look something like this:
6569

6670
![CMake settings dialog](media/cmake-settings-editor2.png)
6771

6872
> [!Note]
69-
> In the **Toolset** dropdown, **msvc_arm64** uses 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** uses 64-bit host tools to cross-compile to ARM64--which is what you will do in this tutorial.
73+
> In the **Toolset** dropdown, **msvc_arm64** selects 32-bit host tools to cross-compile to ARM64, whereas **msvc_arm64 x64** selects 64-bit host tools to cross-compile to ARM64--which is what you will do in this tutorial.
7074
71-
Save the `CMakeSettings.json` file and ensure that your **arm64-debug** configuration is selected in the configuration dropdown:
75+
Save the `CMakeSettings.json` file. In the configuration dropdown, select **arm64-debug** (it may take a moment after saving the `CMakeSettings.json` file for it to appear in the list):
7276

7377
![Ensure that arm64-debug is selected in the Visual Studio configurations drop-down](media/vs2019-cmake-manage-configurations-arm.png)
7478

@@ -80,34 +84,34 @@ Change the **Solution Explorer** view to targets view by selecting the **Switch
8084

8185
![Solution explorer switch view button](media/solution-explorer-switch-view.png)
8286

83-
Then double-click **CMake Targets View**. The **CMake Targets View** appears.
87+
Then, in the **Solution Explorer**, double-click **CMake Targets View** to see the project.
8488

85-
In the **Solution Explorer**, open the project folder, **CMakeProject3 Project**, this example, and then right-click the executable and select **Add Debug Configuration**:
89+
Open the project folder (in this example, **CMakeProject3 Project**), and then right-click the executable and select **Add Debug Configuration**:
8690

8791
![Select add debug configuration](media/cmake-targets-add-debug-configuration.png)
8892

8993
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
9094

91-
- `projectTarget` : this is set for you if you added the debug configuration file from the **Solution Explorer** targets view.
95+
- `projectTarget` : this is set for you if you added the debug configuration file from the **Solution Explorer** targets view per the instructions above.
9296
- `remoteMachineName` : set to the IP address of the remote ARM64 machine, or its machine name.
9397

94-
For more information about these, and other `launch.vs.json` settings, see [launch.vs.json schema reference](launch-vs-schema-reference-cpp.md).
98+
For more information about `launch.vs.json` settings, see [launch.vs.json schema reference](launch-vs-schema-reference-cpp.md).
9599

96100
> [!Note]
97101
> If you are using the folder view instead of the targets view in **Solution Explorer**, right-click the `CMakeLists.txt` file and select **Add Debug Configuration**. This experience differs from adding the debug configuration from the targets view in the following ways:
98-
> - You'll be asked to select a debugger (select **C/C++ Remote Windows Debug** in this case).
99-
> - Visual Studio will provide less configuration template information in the `launch.vs.json` file so you'll need to add it yourself, such as the `remoteMachineName` and `projectTarget` entries. Alternatively, when you add the configuration from the targets view, you only need to specify `remoteMachineName`.
100-
> - For the `projectTarget` setting value, check the startup item dropdown to get the unique name of your target, for example, `CMakeProject3.exe', in this tutorial.
102+
> - You'll be asked to select a debugger (select **C/C++ Remote Windows Debug**).
103+
> - Visual Studio will provide less configuration template information in the `launch.vs.json` file so you'll need to add it yourself. You'll need to provide the `remoteMachineName` and `projectTarget` entries. When you add the configuration from the targets view, you only need to specify `remoteMachineName`.
104+
> - For the `projectTarget` setting value, check the startup item dropdown to get the unique name of your target, for example, in this tutorial it is `CMakeProject3.exe'.
101105
102106
## Start the remote debugger monitor on the remote Windows machine
103107

104108
Before you run your CMake project, ensure that the Visual Studio 2019 remote debugger is running on the remote Windows machine. You may need to change the remote debugger options depending on your authentication situation.
105109

106-
From the Visual Studio Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
110+
For example, on the remote machine, from the Visual Studio Remote Debugger menu bar, select **Tools** > **Options**. Set the **authentication mode** to match how your environment is set up:
107111

108112
![Remote debugger authentication options](media/remote-debugger-options.png)
109113

110-
If you choose **No Authentication**, update the `launch.vs.json` file in your project by adding **"windowsAuthenticationType": "Remote Windows with No authentication"** to the `configurations` section `launch.vs.json`. Otherwise, `"windowsAuthenticationType"` defaults to `"Remote Windows authentication"` and doesn't need to be explicitly stated. For example:
114+
Then, in Visual Studio on the host machine, update the `launch.vs.json` file to match. For example, if you choose **No Authentication** on the remote debugger, update the `launch.vs.json` file in your project by adding **"windowsAuthenticationType": "Remote Windows with No authentication"** to the `configurations` section `launch.vs.json`. Otherwise, `"windowsAuthenticationType"` defaults to `"Remote Windows authentication"` and doesn't need to be explicitly stated. This example is the `launch.vs.json` file, configured for no authentication:
111115

112116
``` XAML
113117
{
@@ -141,7 +145,7 @@ If you choose **No Authentication**, update the `launch.vs.json` file in your pr
141145

142146
On the host machine, in the Visual Studio **Solution Explorer**, open the CPP file for your CMake project. If you're still in **CMake Targets View**, you'll need to open the **(executable)** node to see it.
143147

144-
The default CPP file is a simple hello world console app. Set a breakpoint on `return 0;` so that the program doesn't quickly run and close on the remote machine.
148+
The default CPP file is a simple hello world console app. Set a breakpoint on `return 0;` so that the program doesn't close on the remote machine.
145149

146150
On the Visual Studio toolbar, use the **Startup Item** dropdown to select the name you specified for `"name"` in your `launch.vs.json` file:
147151

@@ -155,6 +159,7 @@ If it doesn't start, ensure that the following are set correctly in the `launch.
155159
- `"projectTarget"` should match the name of the CMake target you want to debug.
156160
- `"type"` should be `"remoteWindows"`
157161
- If the authentication type on the remote debugger is set to **No Authentication**, you should have `"windowsAuthenticationType": "Remote Windows with No authentication"` set in the `launch.vs.json` file.
162+
- If you are using Windows authentication, sign in when prompted using an account recognized by the remote machine.
158163

159164
After the project builds, the app should appear on the remote ARM64 Windows machine:
160165

docs/build/launch-vs-schema-reference-cpp.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Used when debugging and deploying an app on a remote machine.
6969
|`deployRuntimeLibraries`|string|Specifies to deploy the runtime libraries for the active platform. Defaults to `"true"` if the active configurationType is `"MinSizeRel"`, `"RelWithDebInfo"`, or `"Release"`.|
7070
|`disableDeploy` | boolean | Specifies whether any files should be deployed. |
7171
|`remoteMachineName`|string|Specifies the name of the remote ARM64 Windows machine where the program is launched. May be the server name or the remote machine's IP address|
72-
|`windowsAuthenticationType`|string|Specifies the type of remote connection. Possible values are `"Remote Windows authentication"` and `"Remote Windows with No authentication"`. The default is `"Remote Windows authentication"`. This should match the authentication setting specified on the remote debugger running on the remote macihne.|
72+
|`windowsAuthenticationType`|string|Specifies the type of remote connection. Possible values are `"Remote Windows authentication"` and `"Remote Windows with No authentication"`. The default is `"Remote Windows authentication"`. This should match the authentication setting specified on the remote debugger running on the remote machine.|
7373

7474
## <a name="launch_setup_commands"></a> Launch setup commands
7575

docs/build/media/startup-item.png

-4.44 KB
Loading

0 commit comments

Comments
 (0)