[英]Trying to Debug C code in VSC? Unexpected GDB output from command "-exec-run"
所以我試圖在 Visual Studio Code 中調試我的 C 代碼。 我在 windows 上,我安裝了 cygwin,我想使用 gdb 來調試我的程序。
我的 gdb 版本:GNU gdb (GDB) (Cygwin 10.2-1) 10.2
我的 gcc 版本:gcc (GCC) 9.3.0
我收到此錯誤消息:錯誤:無法開始調試。 來自命令“-exec-run”的意外 GDB output。 創建過程出錯...
這是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"
}
]
}
將 gdb 降級到 9.2 版似乎可以解決問題::)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.