Skip to content

Commit 6328362

Browse files
TylerMSFTTylerMSFT
authored andcommitted
edit pass
1 parent bb3656e commit 6328362

File tree

2 files changed

+37
-33
lines changed

2 files changed

+37
-33
lines changed

docs/build/cmake-remote-debugging.md

Lines changed: 37 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,55 @@
22
title: "Tutorial: Run and debug a CMake project on a remote machine"
33
ms.date: "11/20/2020"
44
ms.topic: tutorial
5-
description: "How to setup, run, and debug a CMake project on a remote machine"
5+
description: "How to set up, run, and debug a CMake project on a remote machine"
66
---
77

88
# Tutorial: Run and debug a CMake project on a remote machine
99

10-
This tutorial shows how to use Visual Studio for C++ on Windows to create and build a CMake project on x86 Windows, and then deploy it to run on an ARM device. In this tutorial, you'll deploy and run on an ARM device, but you could just as easily deploy and run on a Linux or other Windows device.
10+
This tutorial shows how to use Visual Studio C++ on Windows to create and build a CMake project than you can deploy and debug on an ARM device. The steps can be generalized to deploy and debug a CMake project on a remote Windows device.
1111

12-
In this tutorial, you learn how to:
12+
In this tutorial, you'll learn how to:
1313

1414
> [!div class="checklist"]
1515
>
1616
> * create a CMake project
17-
> * configure it to build for ARM
18-
> * configure debugging for a remote ARM device
19-
> * build and debug the target on a remote ARM device
17+
> * configure a CMake project to build for ARM
18+
> * configure a CMake project to run on a remote ARM device
19+
> * debug a CMake project running on a remote ARM device
2020
2121
## Prerequisites
2222

2323
### On the host machine
2424

25-
Setup Visual Studio for cross-platform C++ development by installing the ARM build tools:
25+
Set up Visual Studio for cross-platform C++ development by installing the ARM build tools:
2626

27-
VS installer > Modify > Individual Components
27+
Todo! VS installer > Modify > Individual Components
2828
In the **Compilers, build tools, and runtimes** section install
2929
C++ ARM64 build tools (v14.28)
3030

31-
### On the target machine
31+
### On the remote machine
3232

33-
Install the remote debugging tools on the remote machine. This tutorial targets ARM, so install the ARM version of the Visual Studio 2019 remote debugging tools.
33+
Install the remote debugging tools on the remote machine.
34+
35+
ToDo! This tutorial targets ARM, so install the ARM version of the Visual Studio 2019 remote debugging tools.
3436
[link to download](https://visualstudio.microsoft.com/downloads/#remote-tools-for-visual-studio-2019)
3537

3638
## Create a CMake project
3739

3840
On the Windows host machine, run Visual Studio and choose **Create new project** > **CMake Project** > **Next**
3941
Give the project a name and choose a location. Then select **Create**.
4042

41-
Give Visual Studio a few moments to create the project and populate the Solution Explorer.
43+
Give Visual Studio a few moments to create the project and populate the **Solution Explorer**.
4244

4345
## Change the configuration to target ARM
4446

45-
In the **Configuration** dropdown, choose **Manage Configurations...**
47+
Because you are targeting an ARM device, you need to use the ARM build tools. To select the ARM build tools, select the Visual Studio **Configuration** dropdown and select **Manage Configurations...**
4648

47-
![CMake configurations drop-down](media/vs2019-cmake-manage-configurations.png)
49+
![Choose Manage Configurations in the Visual Studio configurations drop-down](media/vs2019-cmake-manage-configurations.png)
4850

49-
Change the **Configuration name** to **x64arm-debug**. This is to make it clear that we've modified this configuration to target ARM.
51+
Change the **Configuration name** to **x64arm-debug**. This name is to make it apparent that we've modified the configuration to target ARM.
5052

51-
Change the **Toolset** dropdown to **msvc_arm64_x64**. Your settings should look something like this:
53+
Select the **Toolset** dropdown and from the list of build tools, choose **msvc_arm64_x64**. Your settings should look something like this:
5254

5355
![CMake settings dialog](media/cmake-settings-editor2.png)
5456

@@ -57,30 +59,32 @@ Change the **Toolset** dropdown to **msvc_arm64_x64**. Your settings should look
5759
5860
## Add a debug configuration file
5961

60-
To configure the project to debug remotely on another machine, first change the **Solution Explorer** view to targets view by selecting the **Switch Views** button in the **Solution Explorer**:
62+
Next, add configuration information that tells Visual Studio where to find your remote machine, and other configuration details.
63+
64+
Change the **Solution Explorer** view to targets view by selecting the **Switch Views** button:
6165

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

6468
Then double-click **CMake Targets View**. The **CMake Targets View** appears.
6569

66-
In the **Solution Explorer**, right-click the executable and select **Add Debug Configuration**.
70+
In the **Solution Explorer**, right-click the executable and select **Add Debug Configuration**:
6771

68-
![Solution explorer switch view button](media/cmake-targets-add-debug-configuration.png)
72+
![Select add debug configuration](media/cmake-targets-add-debug-configuration.png)
6973

70-
This creates a `launch.vs.json` file. Change the following entries to enable remote debugging:
74+
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
7175

72-
`projectTarget` : set to the name of your executable, for example, `CMakeProject1`
73-
`remoteMachineName` : set to either the IP address, or the machine name, of your remote ARM machine or ARM virtual machine.
76+
- `projectTarget` : set to the name of your executable; for example, `CMakeProject3`
77+
- `remoteMachineName` : set to the IP address of the remote ARM machine, or its machine name.
7478

7579
## Start the remote debugger monitor on the ARM device
7680

77-
Before you run your CMake project, ensure that the Visual Studio 2019 remote debugger is running on the remote ARM machine. You may need to change the options depending on your authentication situation.
81+
Before you run your CMake project, ensure that the Visual Studio 2019 remote debugger is running on the remote ARM machine. You may need to change the remote debugger options depending on your authentication situation.
7882

79-
From the VS Remote Debugger, set authentication to match how your environment is setup:
83+
From the VS Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
8084

8185
![Remote debugger authentication options](media/remote-debugger-options.png)
8286

83-
If you choose **No Authentication**, in the `launch.vs.json` file, add **"windowsAuthenticationType": "Remote Windows with No authentication"** to the `configurations` section `launch.vs.json`. For example:
87+
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`. For example:
8488

8589
``` XAML
8690
{
@@ -114,22 +118,22 @@ Otherwise, `"windowsAuthenticationType"` defaults to `"Remote Windows authentica
114118

115119
## Debug the app
116120

117-
In the **Solution Explorer**, open the CPP file. If you are still in **CMake Targets View**, you'll need to open the **(executable)** node to see it.
121+
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.
118122

119-
The default CPP file is a simple hello world console app. Set a breakpoint on the `return 0;` line so that the program doesn't quickly run and close on the remote machine.
123+
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.
120124

121125
On the Visual Studio toolbar, use the startup item dropdown to change the startup item to match the name you specified for `"name"` in the `launch.vs.json` file:
122126

123127
![Startup item dropdown](media/startup-item.png)
124128

125-
From the VS toolbar, choose **Debug** > **Start Debugging** (or press **F5**)
129+
To start debugging, on the VS toolbar choose **Debug** > **Start Debugging** (or press **F5**).
126130

127-
If it doesn't start, ensure that the following are set correctly in the launch.vs.json file:
128-
- `"remoteMachineName"` set to the IP address or name of the remote machine
129-
- `"name"` is what your startup item in Visual Studio is set to
130-
- `"projectTarget"` is set to the name of the executable
131-
- `"type"` is set to `"remoteWindows"`
132-
- If your authentication type on the remote debugger is set to **No Authentication**, that you have `"windowsAuthenticationType": "Remote Windows with No authentication"` set in the `launch.vs.json` file.
131+
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
132+
- `"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM device.
133+
- `"name"` should match the selection in the VS startup item dropdown.
134+
- `"projectTarget"` should be set to the name of the executable file.
135+
- `"type"` should be set to `"remoteWindows"`
136+
- 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.
133137

134138
After the project builds, the app should appear on the remote ARM machine:
135139

16 KB
Loading

0 commit comments

Comments
 (0)