我已经为attach设置了launch.json,如下所示。基本上是用我的python解释器作为程序
{
"name": "(gdb) Attach",
"type": "cppdbg",
"request": "attach",
"program": "/home/mike/.pyenv/versions/anaconda3/bin/python",
"processId": "${command:pickProcess}",
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
},
不幸的是,什么都没发生。我对Visual Studio代码的调试还很陌生,所以可能遗漏了一些琐碎的东西。