Skip to content

Unable to debug with gdb  #7877

@Priyansh2001here

Description

@Priyansh2001here

Bug type: Debugger

Describe the bug

  • OS and Version: Win 11
  • VS Code Version: 1.58.2
  • C/C++ Extension Version: 1.5.1

Hi, I am trying to debug my c++ code but for some reason it doesn't work. I have installed cygwin tool chain with gcc and gdb. Cygwin Binary path is included in path

This is my 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": "g++.exe - Build and debug active file",
      "type": "cppdbg",
      "request": "launch",
      "program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
      "args": [],
      "stopAtEntry": false,
      "cwd": "${workspaceFolder}",
      "environment": [],
      "externalConsole": false,
      "MIMode": "gdb",
      "miDebuggerPath": "C:\\cygwin64\\bin\\gdb.exe",
      "setupCommands": [
        {
          "description": "Enable pretty-printing for gdb",
          "text": "-enable-pretty-printing",
          "ignoreFailures": true
        }
      ],
      "preLaunchTask": "C/C++: g++.exe build active file",
      "logging": { "engineLogging": true }
    }
  ]
}

and

 & 'c:\Users\singh\.vscode\extensions\ms-vscode.cpptools-1.5.1\debugAdapters\bin\WindowsDebugLauncher.exe' '--stdin=Microsoft-MIEngine-In-zpklk1hu.s2l' '--stdout=Microsoft-MIEngine-Out-dsovyjxr.c3x' '--stderr=Microsoft-MIEngine-Error-urlfqomx.lh3' '--pid=Microsoft-MIEngine-Pid-trlahjpt.5hr' '--dbgExe=C:\cygwin64\bin\gdb.exe' '--interpreter=mi'

this is all i got in terminal

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions