【发布时间】:2020-07-10 09:21:31
【问题描述】:
我正在尝试使用 GDB 在 C++ 项目中的 VSCode 中运行调试器,但在运行调试器时我不断收到此错误。我已经设置了证书和所有内容,但它仍然给我这个错误(我正在运行 macOS Catalina 版本 10.15.4)。
这是我的 launch.json 文件
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Assignment8",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
这是我的 tasks.json 文件
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "echo",
"type": "shell",
"command": "make",
"options": {
"cwd": "${workspaceFolder}/build"
},
}
]
}
另外,我看到了一些关于制作 .gdbinit 文件的内容,我在我的根目录中做了这个,我在其中放置了以下命令:
set startup-with-shell off
对于这个问题的任何帮助将不胜感激。
【问题讨论】:
标签: c++ debugging visual-studio-code cmake gdb