因此,我试图在代码中调试我的C代码。我在windows上,我已经安装了cygwin,我想使用gdb来调试我的程序。
我的gdb版本: GNU gdb (GDB) (Cygwin 10.2-1) 10.2
gcc版: gcc (GCC) 9.3.0
我得到以下错误消息:错误:无法启动调试。来自命令"-exec-run“的意外GDB输出。创建过程出错..。
这是我正在使用的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": "gcc.exe - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}\\${fileBasenameNoExtension}.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${fileDirname}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\cygwin64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
],
"preLaunchTask": "C/C++: gcc.exe build active file"
}
]
}发布于 2021-12-09 12:33:02
将gdb降级到9.2版似乎很管用!:)
https://stackoverflow.com/questions/70279267
复制相似问题