microsoft / microsoft/vscode-cpptools
GDB debugger in C/C++ Extension Not Functioning
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Type: Debugger
GDB debugger not hitting breakpoints, non-stop at entry, no variable list, and shows a "matches multiple schemas when only one must validate" error.
Describe the bug
- OS and Version: Windows 20H2
- VS Code Version: 1.53.2
- C/C++ Extension Version: 1.2.1
I created my tasks.json and launch.json following the official guide, but the debugger won't stop at breakpoints, and my variable list is also empty. I also set the "StopAtEntry" to true, but it doesn't seem like it has added a breakpoint or actually stopped at main. I also got the feedback of "Matches multiple schemas when only one must validate" which I can't figure out.
My VS Code is working remotely linking my WSL, and all my extensions are installed both on my end and the Linux end.
To Reproduce
{
// 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": "gcc_debug",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "gcc build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
Steps to reproduce the behavior:
- Go to the .c file you want to debug and set breakpoints
- Click on start debugging
- See error
Additional context
If applicable, please include logging by adding "logging": { "engineLogging": true, "trace": true, "traceResponse": true } in your launch.json
Add any other context about the problem here including log or error messages in your Debug Console or Output windows.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reported tasks.json and launch.json configuration and reproduce the issue in the stated Windows, WSL, VS Code, and C/C++ Extension versions. Enable engineLogging, trace, and traceResponse in launch.json, then inspect the Debug Console or Output windows for the breakpoint, entry-stop, variable-list, and schema errors. Done means the cause is isolated and the debugger reliably stops and shows variables.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100