前提
c言語のプログラムをデバッグしようとネットで調べてやってみましたが、どうしても下記のポップアップが出てきてデバッグができません。
実現したいこと
vscodeでc言語のデバッグ
発生している問題・エラーメッセージ
unable to start debugging. unexpected gdb output from command
該当のソースコード
C
1#include <stdio.h> 2 3int main(void) 4{ 5 printf("Hello, world!\n"); 6 return 0; 7} 8 9・launch.json 10{ 11 // IntelliSense を使用して利用可能な属性を学べます。 12 // 既存の属性の説明をホバーして表示します。 13 // 詳細情報は次を確認してください: https://go.microsoft.com/fwlink/?linkid=830387 14 "version": "0.2.0", 15 "configurations": [ 16 { 17 "name": "(gdb) 起動", 18 "type": "cppdbg", 19 "request": "launch", 20 "program": "${workspaceFolder}\\hello.exe", 21 "args": [], 22 "stopAtEntry": false, 23 "cwd": "${fileDirname}", 24 "environment": [], 25 "externalConsole": false, 26 "MIMode": "gdb", 27 "miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe", 28 "setupCommands": [ 29 { 30 "description": "gdb の再フォーマットを有効にする", 31 "text": "-enable-pretty-printing", 32 "ignoreFailures": true 33 }, 34 { 35 "description": "逆アセンブリ フレーバーを Intel に設定", 36 "text": "-gdb-set disassembly-flavor intel", 37 "ignoreFailures": true 38 } 39 ] 40 } 41 42 ] 43} 44 45・tasks.json 46{ 47 "tasks": [ 48 { 49 "type": "cppbuild", 50 "label": "C/C++: gcc.exe アクティブなファイルのビルド", 51 "command": "C:\\MinGW\\bin\\gcc.exe", 52 "args": [ 53 "-fdiagnostics-color=always", 54 "-g", 55 "${file}", 56 "-o", 57 "${fileDirname}\\${fileBasenameNoExtension}.exe" 58 ], 59 "options": { 60 "cwd": "${fileDirname}" 61 }, 62 "problemMatcher": [ 63 "$gcc" 64 ], 65 "group": { 66 "kind": "build", 67 "isDefault": true 68 }, 69 "detail": "デバッガーによって生成されたタスク。" 70 } 71 ], 72 "version": "2.0.0" 73} 74 75・c_cpp_properties.json 76{ 77 "configurations": [ 78 { 79 "name": "Win32", 80 "includePath": [ 81 "${workspaceFolder}/**" 82 ], 83 "defines": [ 84 "_DEBUG", 85 "UNICODE", 86 "_UNICODE" 87 ], 88 "windowsSdkVersion": "10.0.19041.0", 89 "compilerPath": "C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.33.31629/bin/Hostx64/x64/cl.exe", 90 "cStandard": "c17", 91 "cppStandard": "c++17", 92 "intelliSenseMode": "windows-msvc-x64" 93 }, 94 { 95 "name": "MinGW", 96 "includePath": [ 97 "${workspaceFolder}/**", 98 "C:\\MinGW\\include" 99 ], 100 "defines": [ 101 "_DEBUG", 102 "UNICODE", 103 "_UNICODE" 104 ], 105 "windowsSdkVersion": "10.0.19041.0", 106 "compilerPath": "C:/MinGW/bin/gcc.exe", 107 "cStandard": "c17", 108 "cppStandard": "c++17", 109 "intelliSenseMode": "gcc-x64" 110 } 111 ], 112 "version": 4 113}
試したこと
programやmiDebuggerPathは変更しています。
どこか間違えているのでしょうか?
補足情報(FW/ツールのバージョンなど)
ここにより詳細な情報を記載してください。

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/10/14 04:00
2022/10/14 04:18