admin管理员组文章数量:1390784
Hey does anyone have a fix for the VSCode gdb debugger running inside of the IDE at some point won't observe breakpoints and the red dots turn to little grey circles.
It might be good information that I've had this happen whether the program is a git repo program, a clone or stand-alone. Just at some point the breakpoints stop working almost as thought there comes to be some kind of disconnect between the files that are .cpp and .o and .exe or something. Like some symbol table or something gets out of validity or something.
I've tried cloning directories and I've tried making new directories. I've tried cloning and pushing into brand new repos and I've tried cutting all ties with other programs and git and just using a tar ball without any git stuff in it to reproduce that program and either immediately or eventually my breakpoints lately will stop working in the way described, with the little grey circle.
Here's my tasks.json and launch.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "g++ build active file",
"type": "shell",
"command": "/usr/bin/g++",
"args": [
"-g",
"${workspaceFolder}/src/main.cpp",
"${workspaceFolder}/src/Cmd.cpp",
"${workspaceFolder}/src/Command.cpp",
"${workspaceFolder}/src/EthernetFrame.cpp",
"${workspaceFolder}/src/RxObserver.cpp",
"${workspaceFolder}/src/COM.cpp",
"-o",
"${workspaceFolder}/cmd",
"-I${workspaceFolder}/include",
"-I/usr/include/jsoncpp", // Corrected JSON include path
"-L/usr/lib", // Add this if needed
"-lnet",
"-lpcap",
"-lpthread",
"-ljsoncpp"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"detail": "Generated task to build the project"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug (g++ - Build and Debug active file)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmd",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false, // Use the integrated terminal instead of an external console
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb",
"preLaunchTask": "g++ build active file",
"serverLaunchTimeout": 10000,
"filterStdout": true,
"filterStderr": true,
"sourceFileMap": {
"/usr/local/cmd/src": "${workspaceFolder}/src",
"/usr/local/cmd/include": "${workspaceFolder}/include"
}
}
]
}
Hey does anyone have a fix for the VSCode gdb debugger running inside of the IDE at some point won't observe breakpoints and the red dots turn to little grey circles.
It might be good information that I've had this happen whether the program is a git repo program, a clone or stand-alone. Just at some point the breakpoints stop working almost as thought there comes to be some kind of disconnect between the files that are .cpp and .o and .exe or something. Like some symbol table or something gets out of validity or something.
I've tried cloning directories and I've tried making new directories. I've tried cloning and pushing into brand new repos and I've tried cutting all ties with other programs and git and just using a tar ball without any git stuff in it to reproduce that program and either immediately or eventually my breakpoints lately will stop working in the way described, with the little grey circle.
Here's my tasks.json and launch.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "g++ build active file",
"type": "shell",
"command": "/usr/bin/g++",
"args": [
"-g",
"${workspaceFolder}/src/main.cpp",
"${workspaceFolder}/src/Cmd.cpp",
"${workspaceFolder}/src/Command.cpp",
"${workspaceFolder}/src/EthernetFrame.cpp",
"${workspaceFolder}/src/RxObserver.cpp",
"${workspaceFolder}/src/COM.cpp",
"-o",
"${workspaceFolder}/cmd",
"-I${workspaceFolder}/include",
"-I/usr/include/jsoncpp", // Corrected JSON include path
"-L/usr/lib", // Add this if needed
"-lnet",
"-lpcap",
"-lpthread",
"-ljsoncpp"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": ["$gcc"],
"detail": "Generated task to build the project"
}
]
}
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug (g++ - Build and Debug active file)",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/cmd",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false, // Use the integrated terminal instead of an external console
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"miDebuggerPath": "/usr/bin/gdb",
"preLaunchTask": "g++ build active file",
"serverLaunchTimeout": 10000,
"filterStdout": true,
"filterStderr": true,
"sourceFileMap": {
"/usr/local/cmd/src": "${workspaceFolder}/src",
"/usr/local/cmd/include": "${workspaceFolder}/include"
}
}
]
}
Share
Improve this question
asked Mar 13 at 0:06
kinglouiekinglouie
231 silver badge4 bronze badges
1 Answer
Reset to default 0I've seen this happen before – it’s usually a symptom of a stale or mismatched build. My advice is:
Clean Build: Make sure you’re doing a clean build so that the binary’s debug symbols are up-to-date. Sometimes lingering .o or executable files cause a disconnect.
Source File Mapping: Double-check your
"sourceFileMap"
settings to ensure gdb is looking at the correct source directories.Restart Debugger: Occasionally, simply stopping the debugger (or even VS Code) and starting it again resolves the issue.
If these steps don’t help, it might be worth trying to remove and re-add the breakpoints manually.
本文标签: visual studio codeVSCode DebuggerCNot working Red dot turning to grey cirleStack Overflow
版权声明:本文标题:visual studio code - VSCode Debugger - C++ - Not working. Red dot turning to grey cirle - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744725026a2621911.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论