microsoft / microsoft/vscode-cpptools

GDB debugger in C/C++ Extension Not Functioning

Open
#7,037 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

debugger more info needed
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:

  1. Go to the .c file you want to debug and set breakpoints
  2. Click on start debugging
  3. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.