Skip to content

Commit 90dccbc

Browse files
TylerMSFTTylerMSFT
authored andcommitted
edits
1 parent 0434ff3 commit 90dccbc

File tree

3 files changed

+27
-27
lines changed

3 files changed

+27
-27
lines changed

docs/build/cmake-remote-debugging.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
title: "Tutorial: Run and debug a CMake project on a remote machine"
3-
ms.date: "11/20/2020"
2+
title: "Tutorial: Debug a CMake project on a remote ARM64 Windows machine"
3+
ms.date: "11/21/2020"
44
ms.topic: tutorial
55
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."
66
---
77

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

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 a remote ARM64 Windows machine. The steps can be generalized to deploy and debug a CMake project that doesn't target ARM64.
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.
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 will result in an error that VS can't find the remote machine.
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.
1313

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

@@ -26,41 +26,43 @@ In this tutorial, you'll learn how to:
2626

2727
To set up Visual Studio for cross-platform C++ development, install the ARM64 build tools:
2828

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?view=vs-2019#:~:text=Install%20Visual%20Studio%201%20Make%20sure%20your%20computer,...%204%20Choose%20workloads.%20...%20More%20items...%20)
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)
3030
1. On the Visual Studio Installer home screen, choose **Modify**. (Look under **More** if you don't see it).
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:
34-
- **C++ Cmake tools for Windows**
34+
- **C++ CMake tools for Windows**
3535
- **MSVC v142 - VS 2019 C++ ARM64 build tools (v14.28)** (choose the latest version)
3636
1. Select **Modify** to install the tools.
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?view=vs-2019&viewFallbackFrom=vs-2019%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?view=vs-2019&viewFallbackFrom=vs-2019%23download-and-install-the-remote-tools#BKMK_setup) on the remote ARM64 machine.
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.
4242

4343
## Create a CMake project
4444

45-
On the Windows host machine, run Visual Studio and choose **Create new project** > **CMake Project** > **Next**
46-
Give the project a name and choose a location. Then select **Create**.
45+
On the Windows host machine:
46+
1. Run Visual Studio
47+
1. From the main menu, select **Create new project** > **CMake Project** > **Next**
48+
1. Give the project a name and choose a location. Then select **Create**.
4749

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

5052
## Change the configuration to target ARM64
5153

52-
Because you are targeting an ARM64 Windows machine, you need to use the ARM64 build tools. To select the ARM64 build tools, select the Visual Studio **Configuration** dropdown and select **Manage Configurations...**
54+
Because you're targeting an ARM64 Windows machine, you need to use the ARM64 build tools. To select the ARM64 build tools, select the Visual Studio **Configuration** dropdown and select **Manage Configurations...**
5355

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

56-
Change the **Configuration name** to **arm64-debug**. This is a unique, friendly name to make it easier for you to identify these settings.
58+
Change the **Configuration name** to **arm64-debug**. This is a unique, friendly name to make it easier for you to identify these settings in the **Configuration** dropdown.
5759

58-
Select the **Toolset** dropdown and from the list of build tools, choose **msvc_arm64_x64**. Your settings should look something like this:
60+
Select the **Toolset** dropdown. From the list of build tools, choose **msvc_arm64_x64**. Your settings should now look something like this:
5961

6062
![CMake settings dialog](media/cmake-settings-editor2.png)
6163

6264
> [!Note]
63-
> 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.
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.
6466
6567
Save the `CMakeSettings.json` file and ensure that your **arm64-debug** configuration is selected in the configuration dropdown:
6668

@@ -83,18 +85,18 @@ In the **Solution Explorer**, right-click the executable and select **Add Debug
8385

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

86-
- `projectTarget` : set to the name of your target, for example, `CMakeProject3.exe` You can check the
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.
8789
- `remoteMachineName` : set to the IP address of the remote ARM64 machine, or its machine name.
8890

8991
## Start the remote debugger monitor on the ARM64 Windows machine
9092

91-
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.
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.
9294

93-
From the VS Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
95+
From the Visual Studio Remote Debugger menu bar, select **Tools** > **Options**. Then set authentication to match how your environment is set up:
9496

9597
![Remote debugger authentication options](media/remote-debugger-options.png)
9698

97-
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:
99+
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:
98100

99101
``` XAML
100102
{
@@ -124,34 +126,32 @@ If you choose **No Authentication**, update the `launch.vs.json` file in your pr
124126
}
125127
```
126128

127-
Otherwise, `"windowsAuthenticationType"` defaults to `"Remote Windows authentication"` and doesn't need to be explicitly stated.
128-
129129
## Debug the app
130130

131131
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.
132132

133133
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.
134134

135-
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:
135+
On the Visual Studio toolbar, use the **Startup Item** dropdown to select the name you specified for `"name"` in your `launch.vs.json` file:
136136

137137
![Example startup item dropdown with CMakeProject3.exe selected](media/startup-item.png)
138138

139-
To start debugging, on the VS toolbar choose **Debug** > **Start Debugging** (or press **F5**).
139+
To start debugging, on the Visual Studio toolbar choose **Debug** > **Start Debugging** (or press **F5**).
140140

141141
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
142142
- `"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM64 Windows machine.
143-
- `"name"` should match the selection in the VS startup item dropdown.
143+
- `"name"` should match the selection in the Visual Studio startup item dropdown.
144144
- `"projectTarget"` should match the name of the executable file.
145145
- `"type"` should be `"remoteWindows"`
146146
- 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.
147147

148-
After the project builds, the app should appear on the remote ARM64 machine:
148+
After the project builds, the app should appear on the remote ARM64 Windows machine:
149149

150-
![Hello Cmake console app running on remote Windows ARM64 machine](media/remote-cmake-app.png)
150+
![Hello CMake console app running on remote Windows ARM64 machine](media/remote-cmake-app.png)
151151

152152
## What you learned
153153

154-
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 Windows machine.
154+
In this tutorial, you created a CMake project, configured it to build for Windows on ARM64, and debugged it on a remote ARM64 Windows machine.
155155

156156
## Next steps
157157

10.4 KB
Loading
38 Bytes
Loading

0 commit comments

Comments
 (0)