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/build/cmake-remote-debugging.md
+23-17Lines changed: 23 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,27 +2,29 @@
2
2
title: "Tutorial: Run and debug a CMake project on a remote machine"
3
3
ms.date: "11/20/2020"
4
4
ms.topic: tutorial
5
-
description: "How to set up, run, and debug a CMake project on a remote machine"
5
+
description: "How to use Visual Studio C++ on Windows to create and build a CMake project than you can deploy and debug on an ARM64 device."
6
6
---
7
7
8
8
# Tutorial: Run and debug a CMake project on a remote machine
9
9
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.
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 ARM64 device. The steps can be generalized to deploy and debug a CMake project that doesn't target ARM64.
11
+
12
+
This tutorial focuses on ARM64 because the default debugging experience for ARM64 is remote debugging. Attempting to debug ARM64 without configuring your CMake project as shown in this tutorial will result in an error that VS can't find the remote machine.
11
13
12
14
In this tutorial, you'll learn how to:
13
15
14
16
> [!div class="checklist"]
15
17
>
16
18
> * create a CMake project
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
19
+
> * configure a CMake project to build for ARM64
20
+
> * configure a CMake project to run on a remote ARM64 device
21
+
> * debug a CMake project running on a remote ARM64 device
20
22
21
23
## Prerequisites
22
24
23
25
### On the host machine
24
26
25
-
Set up Visual Studio for cross-platform C++ development by installing the ARM build tools:
27
+
Set up Visual Studio for cross-platform C++ development by installing the ARM64 build tools:
26
28
27
29
Todo! VS installer > Modify > Individual Components
28
30
In the **Compilers, build tools, and runtimes** section install
Install the remote debugging tools on the remote machine.
34
36
35
-
ToDo! This tutorial targets ARM, so install the ARM version of the Visual Studio 2019 remote debugging tools.
37
+
ToDo! This tutorial targets ARM64, so install the ARM64 version of the Visual Studio 2019 remote debugging tools.
36
38
[link to download](https://visualstudio.microsoft.com/downloads/#remote-tools-for-visual-studio-2019)
37
39
38
40
## Create a CMake project
@@ -42,20 +44,20 @@ Give the project a name and choose a location. Then select **Create**.
42
44
43
45
Give Visual Studio a few moments to create the project and populate the **Solution Explorer**.
44
46
45
-
## Change the configuration to target ARM
47
+
## Change the configuration to target ARM64
46
48
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...**
49
+
Because you are targeting an ARM64 device, you need to use the ARM64 build tools. To select the ARM64 build tools, select the Visual Studio **Configuration** dropdown and select **Manage Configurations...**
48
50
49
51

50
52
51
-
Change the **Configuration name** to **x64arm-debug**. This name is to make it apparent that we've modified the configuration to target ARM.
53
+
Change the **Configuration name** to **arm64-debug**. This is a unique, friendly name to make it easier for you to identify these settings.
52
54
53
55
Select the **Toolset** dropdown and from the list of build tools, choose **msvc_arm64_x64**. Your settings should look something like this:
> In the **Toolset** dropdown, **msvc_arm** builds for 32-bit ARM, **msvc_arm64** builds for 64-bit ARM, and **msvc_arm64 x64**builds for 64-bit ARM from an x64 host--which is what you are doing in this tutorial.
60
+
> In the **Toolset** dropdown, **msvc_arm64** builds for 64-bit ARM, and **msvc_arm64 x64**uses the 64-bit host tools to cross-compile for ARM64--which is what you will do in this tutorial.
59
61
60
62
## Add a debug configuration file
61
63
@@ -74,11 +76,11 @@ In the **Solution Explorer**, right-click the executable and select **Add Debug
74
76
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
75
77
76
78
-`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.
79
+
-`remoteMachineName` : set to the IP address of the remote ARM64 machine, or its machine name.
78
80
79
-
## Start the remote debugger monitor on the ARM device
81
+
## Start the remote debugger monitor on the ARM64 device
80
82
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.
83
+
Before you run your CMake project, ensure that the Visual Studio 2019 remote debugger is running on the remote ARM64 machine. You may need to change the remote debugger options depending on your authentication situation.
82
84
83
85
From the VS Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
84
86
@@ -129,19 +131,23 @@ On the Visual Studio toolbar, use the startup item dropdown to change the startu
129
131
To start debugging, on the VS toolbar choose **Debug** > **Start Debugging** (or press **F5**).
130
132
131
133
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.
134
+
-`"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM64 device.
133
135
-`"name"` should match the selection in the VS startup item dropdown.
134
136
-`"projectTarget"` should be set to the name of the executable file.
135
137
-`"type"` should be set to `"remoteWindows"`
136
138
- 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.
137
139
138
-
After the project builds, the app should appear on the remote ARM machine:
140
+
After the project builds, the app should appear on the remote ARM64 machine:
In this tutorial, you created a CMake project, configured it to build for ARM and to run on a remote machine. Then you built, ran, and debugged it on a remote ARM device.
146
+
In this tutorial, you created a CMake project, configured it to build for ARM64 and to run on a remote machine. Then you built, ran, and debugged it on a remote ARM64 device.
0 commit comments