【发布时间】:2020-12-08 22:49:43
【问题描述】:
一旦我设置了launch.json 并运行gdb 并成功调试了我的代码,直到发生了一些事情并且所有断点都变成了“灰色”并出现这样的消息:
“包含此断点的模块尚未加载或无法获取断点地址。”
但是,调试器附加到正在运行的程序,我什至可以从main 开始执行步骤,但仍然没有命中断点...这是使用cmake 和gcc 和-DCMAKE_BUILD_TYPE=DEBUG 标志构建的C++ 项目.
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": "./MyProject/project",
"args": [],
"stopAtEntry": false,
"cwd": "/home/AA/workspace",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerServerAddress": "/*Cannot write here, but it's fine*/",
"sourceFileMap": {/*Cannot write here, but it*/}
},
]
}
我该如何解决这个问题?
【问题讨论】:
标签: docker debugging visual-studio-code cmake gdb