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/configure-cmake-debugging-sessions.md
+6-12Lines changed: 6 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -83,14 +83,14 @@ There are many *launch.vs.json* properties to support all your debugging scenari
83
83
84
84
## Launch.vs.json reference for remote projects and WSL
85
85
86
-
In Visual Studio 2019 version 16.6 we added a new debug configuration of `type: cppgdb` to simplify debugging with **gdb** and **gdbserver**on remote systems and WSL. Old debug configurations of `type: cppdbg` are still supported.
86
+
In Visual Studio 2019 version 16.6 we added a new debug configuration of `type: cppgdb` to simplify debugging on remote systems and WSL. Old debug configurations of `type: cppdbg` are still supported.
87
87
88
88
### Configuration type `cppgdb`
89
89
90
90
-`name`: A friendly name to identify the configuration in the **Startup Item** dropdown.
91
91
-`project`: Specifies the relative path to the project file. You shouldn't need to change this when debugging a CMake project.
92
92
-`projectTarget`: Specifies the CMake target to invoke when building the project. Visual Studio autopopulates this property if you enter *launch.vs.json* from the **Debug Menu** or **Targets View**. This value must match the name of an existing debug target listed in the **Startup Item** dropdown.
93
-
-`debuggerConfiguration`: Indicates which set of debugging default values to use. Valid options are **gdb** and **gdbserver**.
93
+
-`debuggerConfiguration`: Indicates which set of debugging default values to use. In Visual Studio 2019 version 16.6, the only valid option is **gdb**.
94
94
-`args`: Command-line arguments passed on startup to the program being debugged.
95
95
-`env`: Additional environment variables passed to the program being debugged. For example, `{"DISPLAY": "0.0"}`.
96
96
-`processID`: Linux process ID to attach to. Only used when attaching to a remote process. For more information, see [Troubleshoot attaching to processes using GDB](https://github.com/Microsoft/MIEngine/wiki/Troubleshoot-attaching-to-processes-using-GDB).
@@ -103,18 +103,9 @@ In Visual Studio 2019 version 16.6 we added a new debug configuration of `type:
103
103
-`gdbpath`: Defaults to `/usr/bin/gdb`. Full Unix path to the gdb used to debug. Only required if using a custom version of gdb.
104
104
-`preDebugCommand`: A Linux command to run immediately before invoking gdb. Gdb will not start until it completes. You can use this to run a script before the execution of gdb.
105
105
106
-
#### Additional options allowed with the `gdbserver` configuration
107
-
108
-
-`program`: Defaults to `"${debugInfo.fullTargetPath}"`. The Unix path to the application to debug. Only required if different than the target executable in the build or deploy location.
109
-
-`remoteMachineName`: Defaults to `"${debugInfo.remoteMachineName}"`. Name of the remote system that hosts the program to debug. Only required if different than the build system. Must have an existing entry in the [Connection Manager](../linux/connect-to-your-remote-linux-computer.md). Press **Ctrl+Space** to view a list of all existing remote connections.
110
-
-`cwd`: Defaults to `"${debugInfo.defaultWorkingDirectory}"`. Full Unix path to the directory on the remote system where `program` is run. The directory must exist.
111
-
-`gdbPath`: Defaults to `${debugInfo.vsInstalledGdb}`. Full Windows path to the gdb used to debug. Defaults to the gdb installed with the Linux development with C/C++ workload.
112
-
-`gdbserverPath`: Defaults to `usr/bin/gdbserver`. Full Unix path to the gdbserver used to debug.
113
-
-`preDebugCommand`: A Linux command to run immediately before starting gdbserver. Gdbserver will not start until it completes.
114
-
115
106
#### Deployment options
116
107
117
-
Use the following options to separate your build machine (defined in CMakeSettings.json) from your remote debug machine. These options apply to both `gdb` and `gdbserver` configurations.
108
+
Use the following options to separate your build machine (defined in CMakeSettings.json) from your remote debug machine.
118
109
119
110
-`remoteMachineName`: Remote debug machine. Only required if different than the build machine. Must have an existing entry in the [Connection Manager](../linux/connect-to-your-remote-linux-computer.md). Press **Ctrl+Space** to view a list of all existing remote connections.
120
111
-`disableDeploy`: Defaults to `false`. Indicates whether build/debug separation is disabled. When `false`, this option allows build and debug to occur on two separate machines.
@@ -212,6 +203,9 @@ The following options can be used when debugging on a remote system or WSL using
212
203
213
204
- Finally, all of the deployment options defined for the `cppgdb` configuration type can be used with the `cppdbg` configuration type as well.
214
205
206
+
### Debugging with gdbserver
207
+
You can configure the `cppdbg` configuration to debug with gdbserver. More details and a sample launch configuration can be found [here](https://devblogs.microsoft.com/cppblog/debugging-linux-cmake-projects-with-gdbserver/).
0 commit comments