在Visual Studio 2019 + WSL中。我有构建some.so库的CMake项目。 我的意思是使用WSL上的gdb进行调试,WSL是另一个目录中的可执行文件。该可执行文件使用内置库。
我试图在launch.vs.json中设置项目目标,cwd和程序属性
'''{
"type": "cppdbg",
"name": "some",
"project": "CMakeLists.txt",
"projectTarget": "some",
"cwd": "path/to/some/executable/directory",
"program": "path/to/some/executable",
"MIMode": "gdb",
"externalConsole": true,
"remoteMachineName": "${debugInfo.remoteMachineName}",
"pipeTransport": {
"pipeProgram": "${debugInfo.shellexecPath}",
"pipeArgs": [
"/s",
"${debugInfo.remoteMachineId}",
"/p",
"${debugInfo.parentProcessId}",
"/c",
"${debuggerCommand}",
"--tty=${debugInfo.tty}"
],
"debuggerPath": "/usr/bin/gdb"
},
"setupCommands": [
{
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"visualizerFile": "${debugInfo.linuxNatvisPath}",
"showDisplayString": true
}
'''
Visual Studio 2019要求我选择启动项,但看不到可执行文件。