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
+19-17Lines changed: 19 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
-
title: "Tutorial: Debug a CMake project on a remote ARM64 Windows machine"
3
-
ms.date: "11/21/2020"
2
+
title: "Tutorial: Debug a CMake project on a remote Windows machine"
3
+
ms.date: "12/2/2020"
4
4
ms.topic: tutorial
5
-
description: "How to use Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote ARM64 Windows machine."
5
+
description: "How to use Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote Windows machine."
6
6
---
7
7
8
-
# Tutorial: Debug a CMake project on a remote ARM64 Windows machine
8
+
# Tutorial: Debug a CMake project on a remote Windows machine
9
9
10
-
This tutorial shows how to use Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote ARM64 Windows machine. These steps can be generalized to remotely deploy and debug a CMake project on other architectures.
10
+
This tutorial shows how to use Visual Studio C++ on Windows to create and build a CMake project that you can deploy and debug on a remote Windows machine. This tutorial is specific to ARM64, but the steps can be generalized to remotely deploy and debug a CMake project on other architectures.
11
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 results in an error that Visual Studio can't find the remote machine.
12
+
This tutorial focuses on ARM64 because that's the default remote debugging experience. Attempting to debug without configuring your CMake project as shown in this tutorial will result in an error that Visual Studio can't find the remote machine.
13
13
14
14
In this tutorial, you'll learn how to:
15
15
@@ -24,7 +24,7 @@ In this tutorial, you'll learn how to:
24
24
25
25
### On the host machine
26
26
27
-
To set up Visual Studio for cross-platform C++ development, install the ARM64 build tools:
27
+
To set up Visual Studio for cross-platform C++ development, install the tools that allow you to build for the target architecture. For this tutorial, install the ARM64 build tools:
28
28
29
29
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
30
1. On the Visual Studio Installer home screen, choose **Modify**. (Look under **More** if you don't see it).
@@ -37,8 +37,8 @@ To set up Visual Studio for cross-platform C++ development, install the ARM64 bu
37
37
38
38
### On the remote machine
39
39
40
-
1. Install the ARM64 remote tools on the remote machine 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.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 ARM64 Windows machine.
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.
42
42
43
43
## Create a CMake project
44
44
@@ -62,35 +62,37 @@ Select the **Toolset** dropdown. From the list of build tools, choose **msvc_arm
> In the **Toolset** dropdown, **msvc_arm64**builds for 64-bit ARM. **msvc_arm64 x64** uses the 64-bit host tools to cross-compile for ARM64--which is what you will do in this tutorial.
65
+
> In the **Toolset** dropdown, **msvc_arm64**uses the 32-bit host tools to build for 64-bit ARM. **msvc_arm64 x64** uses the 64-bit host tools to cross-compile for ARM64--which is what you will do in this tutorial.
66
66
67
67
Save the `CMakeSettings.json` file and ensure that your **arm64-debug** configuration is selected in the configuration dropdown:
68
68
69
69

70
70
71
-
72
71
## Add a debug configuration file
73
72
74
-
Next, add configuration information that tells Visual Studio where to find your remote machine, and other configuration details.
73
+
Next, add configuration information that tells Visual Studio where to find your remote machine, along with other configuration details.
75
74
76
75
Change the **Solution Explorer** view to targets view by selecting the **Switch Views** button:
77
76
78
77

79
78
80
79
Then double-click **CMake Targets View**. The **CMake Targets View** appears.
81
80
82
-
In the **Solution Explorer**, right-click the executable and select **Add Debug Configuration**:
81
+
In the **Solution Explorer**, open the project folder, **CMakeProject3 Project**, this this example, and then right-click the executable and select **Add Debug Configuration**:
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
87
86
88
-
-`projectTarget` : set to the name of your target, for example, `CMakeProject3.exe` You can check the startup item dropdown for the .exe file to get this name.
87
+
-`projectTarget` : this will be set correctly if you added the debug configuration file from the **Solution Explorer** targets view. If you added it from folder view, check the startup item dropdown to get the unique name of your target, for example, `CMakeProject3.exe', in this tutorial.
89
88
-`remoteMachineName` : set to the IP address of the remote ARM64 machine, or its machine name.
90
89
91
-
## Start the remote debugger monitor on the ARM64 Windows machine
90
+
> [!Note]
91
+
> If you want to remain in the folder view, in the **Solution Explorer**, right-click the `CMakeLists.txt` file and select **Add Debug Configuration**. This experiences differs in two ways from adding the debug configuration from the targets view. First, you'll be asked to select a debugger (you'd select **C/C++ Remote Windows Debug** in this case). Second, Visual Studio will provide less configuration template information that you'll need to provide yourself, such as changing the **`type`** to **remoteWindows** and adding the **`remoteMachineName`** entry.
92
+
93
+
## Start the remote debugger monitor on the remote Windows machine
92
94
93
-
Before you run your CMake project, ensure that the Visual Studio 2019 remote debugger is running on the remote ARM64 Windows machine. You may need to change the remote debugger options depending on your authentication situation.
95
+
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.
94
96
95
97
From the Visual Studio Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
96
98
@@ -141,7 +143,7 @@ To start debugging, on the Visual Studio toolbar choose **Debug** > **Start Debu
141
143
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
142
144
-`"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM64 Windows machine.
143
145
-`"name"` should match the selection in the Visual Studio startup item dropdown.
144
-
-`"projectTarget"` should match the name of the executable file.
146
+
-`"projectTarget"` should match the name of the CMake target you want to debug.
145
147
-`"type"` should be `"remoteWindows"`
146
148
- 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.
0 commit comments