Skip to content

Commit ab49db7

Browse files
TylerMSFTTylerMSFT
authored andcommitted
tech review feedback
1 parent 1e311cb commit ab49db7

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed

docs/build/cmake-remote-debugging.md

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
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"
44
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."
66
---
77

8-
# Tutorial: Debug a CMake project on a remote ARM64 Windows machine
8+
# Tutorial: Debug a CMake project on a remote Windows machine
99

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.
1111

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.
1313

1414
In this tutorial, you'll learn how to:
1515

@@ -24,7 +24,7 @@ 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 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:
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)
3030
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
3737

3838
### On the remote machine
3939

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.
4242

4343
## Create a CMake project
4444

@@ -62,35 +62,37 @@ Select the **Toolset** dropdown. From the list of build tools, choose **msvc_arm
6262
![CMake settings dialog](media/cmake-settings-editor2.png)
6363

6464
> [!Note]
65-
> 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.
6666
6767
Save the `CMakeSettings.json` file and ensure that your **arm64-debug** configuration is selected in the configuration dropdown:
6868

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

71-
7271
## Add a debug configuration file
7372

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.
7574

7675
Change the **Solution Explorer** view to targets view by selecting the **Switch Views** button:
7776

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

8079
Then double-click **CMake Targets View**. The **CMake Targets View** appears.
8180

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**:
8382

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

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

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.
8988
- `remoteMachineName` : set to the IP address of the remote ARM64 machine, or its machine name.
9089

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
9294

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.
9496

9597
From the Visual Studio Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
9698

@@ -141,7 +143,7 @@ To start debugging, on the Visual Studio toolbar choose **Debug** > **Start Debu
141143
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
142144
- `"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM64 Windows machine.
143145
- `"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.
145147
- `"type"` should be `"remoteWindows"`
146148
- 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.
147149

-9.75 KB
Loading

0 commit comments

Comments
 (0)