Type: Debugger
(I'm sorry for my poor English)
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:
This error only happens when "externalConsole": false
in launch.json. If "externalConsole": true
, it will be normal.
starlinq, lanyizi, Utpal29, devdattapandey2512, MagitekKnight and 4 more
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4