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
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ description: "How to use Visual Studio C++ on Windows to create and build a CMak
9
9
10
10
This tutorial uses 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 Windows ARM64, but the steps can be generalized for other architectures.
11
11
12
-
In Visual Studio, the default debugging experience for ARM64 is remote debugging an ARM64 Windows machine. Debugging an ARM64 CMake project without configuring your debug settings as shown in this tutorial will result in an error that Visual Studio can't find the remote machine.
12
+
In Visual Studio, the default debugging experience for ARM64 is remote debugging an ARM64 Windows machine. If you try to debug an ARM64 CMake project without configuring your debug settings as shown in this tutorial, you'll get 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
@@ -50,7 +50,7 @@ On the Windows host machine:
50
50
51
51
Give Visual Studio a few moments to create the project and populate the **Solution Explorer**.
52
52
53
-
## Change the configuration to target ARM64
53
+
## Configure for ARM64
54
54
55
55
To target an ARM64 Windows machine, you need to build using ARM64 build tools.
56
56
@@ -65,7 +65,7 @@ In the **CMakeSettings** dialog that appears, select **arm64-debug**, and then p
65
65
66
66
This adds a debug configuration named **arm64-Debug** to your *`CmakeSettings.json`* file. This configuration name is a unique, friendly name that makes it easier for you to identify these settings in the **Configuration** dropdown.
67
67
68
-
The **Toolset** dropdown will be set to **msvc_arm64_x64**. Your settings should now look something like this:
68
+
The **Toolset** dropdown will be set to **msvc_arm64_x64**. Your settings should now look like this:
@@ -92,13 +92,13 @@ Open the project folder (in this example, **CMakeProject3 Project**), and then r
92
92
93
93
This creates a `launch.vs.json` file in your project. Open it and change the following entries to enable remote debugging:
94
94
95
-
-`projectTarget`: this is set for you if you added the debug configuration file from the **Solution Explorer** targets view per the instructions above.
96
-
-`remoteMachineName`: set to the IP address of the remote ARM64 machine, or its machine name.
95
+
-`projectTarget`: this is set for you if you added the debug configuration file from the **Solution Explorer** targets view per the instructions above.
96
+
-`remoteMachineName`: set to the IP address of the remote ARM64 machine, or its machine name.
97
97
98
98
For more information about `launch.vs.json` settings, see [launch.vs.json schema reference](launch-vs-schema-reference-cpp.md).
99
99
100
100
> [!Note]
101
-
> If you are using the folder view instead of the targets view in **Solution Explorer**, right-click the `CMakeLists.txt` file and select **Add Debug Configuration**. This experience differs from adding the debug configuration from the targets view in the following ways:
101
+
> If you're using the folder view instead of the targets view in **Solution Explorer**, right-click the `CMakeLists.txt` file and select **Add Debug Configuration**. This experience differs from adding the debug configuration from the targets view in the following ways:
102
102
> - You'll be asked to select a debugger (select **C/C++ Remote Windows Debug**).
103
103
> - Visual Studio will provide less configuration template information in the `launch.vs.json` file so you'll need to add it yourself. You'll need to provide the `remoteMachineName` and `projectTarget` entries. When you add the configuration from the targets view, you only need to specify `remoteMachineName`.
104
104
> - For the `projectTarget` setting value, check the startup item dropdown to get the unique name of your target, for example, in this tutorial it is `CMakeProject3.exe'.
@@ -111,7 +111,7 @@ For example, on the remote machine, from the Visual Studio Remote Debugger menu
Then, in Visual Studio on the host machine, update the `launch.vs.json` file to match. For example, if you choose **No Authentication** on the remote debugger, 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. This example is the`launch.vs.json` file, configured for no authentication:
114
+
Then, in Visual Studio on the host machine, update the `launch.vs.json` file to match. For example, if you choose **No Authentication** on the remote debugger, 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. This example shows a`launch.vs.json` file configured for no authentication:
115
115
116
116
```XAML
117
117
{
@@ -145,7 +145,7 @@ Then, in Visual Studio on the host machine, update the `launch.vs.json` file to
145
145
146
146
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.
147
147
148
-
The default CPP file is a simple hello world console app. Set a breakpoint on `return 0;` so that the program doesn't close on the remote machine.
148
+
The default CPP file is a simple hello world console app. Set a breakpoint on `return 0;`.
149
149
150
150
On the Visual Studio toolbar, use the **Startup Item** dropdown to select the name you specified for `"name"` in your `launch.vs.json` file:
151
151
@@ -154,7 +154,7 @@ On the Visual Studio toolbar, use the **Startup Item** dropdown to select the na
154
154
To start debugging, on the Visual Studio toolbar choose **Debug** > **Start Debugging** (or press **F5**).
155
155
156
156
If it doesn't start, ensure that the following are set correctly in the `launch.vs.json` file:
157
-
-`"remoteMachineName"` should be set to the IP address, or machine name, of the remote ARM64 Windows machine.
157
+
-`"remoteMachineName"` should be set to the IP address, or the machine name, of the remote ARM64 Windows machine.
158
158
-`"name"` should match the selection in the Visual Studio startup item dropdown.
159
159
-`"projectTarget"` should match the name of the CMake target you want to debug.
160
160
-`"type"` should be `"remoteWindows"`
@@ -165,6 +165,8 @@ After the project builds, the app should appear on the remote ARM64 Windows mach
165
165
166
166

167
167
168
+
Visual Studio on the host machine should be stopped at the breakpoint for `return 0;`.
169
+
168
170
## What you learned
169
171
170
172
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.
Copy file name to clipboardExpand all lines: docs/build/launch-vs-schema-reference-cpp.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,13 +63,13 @@ Used when debugging and deploying an app on a remote machine.
63
63
|Property|Type|Description|
64
64
|-|-|-|
65
65
|`cwd`|string|The working directory of the target on the remote machine. When using CMake, the macro `${debugInfo.defaultWorkingDirectory}` can be used as the value of this field. The default value is the directory of the debug program/command.|
66
-
|`deploy`|string|Specifies extra files/directories to deploy. For example:<br> `"deploy": {"sourcePath":"<Full path to source file/directory on host machine>", "targetPath":"<Full destination path to file/directory on target machine>"}`|
67
-
|`deployDirectory`|string|The location on the remote machine where project outputs are automatically deployed to. Defaults to "`C:\Windows Default Deploy Directory\<name of launch entry>`|
68
-
|`deployDebugRuntimeLibraries`|string|Specifies to deploy the debug runtime libraries for the active platform. Defaults to `"true"` if the active configurationType is `"Debug"`|
69
-
|`deployRuntimeLibraries`|string|Specifies to deploy the runtime libraries for the active platform. Defaults to `"true"` if the active configurationType is `"MinSizeRel"`, `"RelWithDebInfo"`, or `"Release"`.|
70
-
|`disableDeploy`| boolean | Specifies whether any files should be deployed. |
71
-
|`remoteMachineName`|string|Specifies the name of the remote ARM64 Windows machine where the program is launched. May be the server name or the remote machine's IP address|
72
-
|`windowsAuthenticationType`|string|Specifies the type of remote connection. Possible values are `"Remote Windows authentication"` and `"Remote Windows with No authentication"`. The default is `"Remote Windows authentication"`. This should match the authentication setting specified on the remote debugger running on the remote machine.|
66
+
|`deploy`|string|Specifies extra files or directories to deploy. For example:<br> `"deploy": {"sourcePath":"<Full path to source file/directory on host machine>", "targetPath":"<Full destination path to file/directory on target machine>"}`|
67
+
|`deployDirectory`|string|The location on the remote machine where project outputs are automatically deployed to. Defaults to "`C:\Windows Default Deploy Directory\<name of app>`|
68
+
|`deployDebugRuntimeLibraries`|string|Specifies whether to deploy the debug runtime libraries for the active platform. Defaults to `"true"` if the active configurationType is `"Debug"`|
69
+
|`deployRuntimeLibraries`|string|Specifies whether to deploy the runtime libraries for the active platform. Defaults to `"true"` if the active configurationType is `"MinSizeRel"`, `"RelWithDebInfo"`, or `"Release"`.|
70
+
|`disableDeploy`| boolean | Specifies whether files should be deployed. |
71
+
|`remoteMachineName`|string|Specifies the name of the remote ARM64 Windows machine where the program is launched. May be the server name or the remote machine's IP address. |
72
+
|`windowsAuthenticationType`|string|Specifies the type of remote connection. Possible values are `"Remote Windows authentication"` and `"Remote Windows with No authentication"`. The default is `"Remote Windows authentication"`. This should match the authentication setting specified on the remote debugger that is running on the remote machine.|
0 commit comments