-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
debuggerfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.more info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current state
Milestone
Description
Type: Debugger
(I'm sorry for my poor English)
- OS and Version: Windows 10 Pro 1809 18290.100
- VS Code Version: 1.29.1
- C/C++ Extension Version: 0.20.1
I want to debug with the built-in terminal on VS Code, so I set "externalConsole": false in launch.json.
But when I started debugging, it told me "Unable to establish a connection to GDB". I have already installed MinGW-w64.
This is my launch.json file:
{
"version": "0.2.0",
"configurations": [
{
"name": "C/C++ Debugging with GDB",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "Compile C/C++"
}
]
}and tasks.json:
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile C/C++",
"command": "g++",
"args": [
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}.exe",
"-g",
"-Wall",
"-lm",
"-std=c++17"
],
"type": "shell",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared"
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": "absolute",
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
}
]
}Steps to reproduce the behavior:
- Open a c/cpp file
- Navigate to Debug panel
- Click "Start Debugging"
- Error happened.
This error only happens when "externalConsole": false in launch.json. If "externalConsole": true, it will be normal.
starlinq, lanyizi, Utpal29, devdattapandey2512, MagitekKnight and 5 more
Metadata
Metadata
Assignees
Labels
debuggerfixedCheck the Milestone for the release in which the fix is or will be available.Check the Milestone for the release in which the fix is or will be available.more info neededThe issue report is not actionable in its current stateThe issue report is not actionable in its current state
