Unable to find GDB in default search path and gdb.
Brief Issue Summary
When I use vscode to debug some simple CPP programs(don't ask me why I do not use JetBrains Clion) in windows, I get this error message: "Unable to find GDB in default search path and gdb." My environment list:
- gcc: JetBrains/CLion 2022.2/bin/mingw/bin/gcc.exe version:11.2
- gdb: JetBrains/CLion 2022.2/bin/gdb/win/bin/gdb.exe version:12.1
- cmake: JetBrains/CLion 2022.2/bin/cmake/win/bin/cmake.exe version:3.23.2
- CMake Tools ——ms-vscode.cmake-tools version:1.12.26
- Windows 11 version:22H2
And when I set the variale
"cmake.debugConfig": {
"miDebuggerPath": "JetBrains/CLion 2022.2/bin/gdb/win/bin/gdb.exe",
"MIMode":"gdb"
}
the debugger's path is right, but it still doesn't solve my problem——Unable to find GDB in default search path and gdb., and the terminal always outputs
gdb --version exited with code: 1 and signal: null
until I add the path of debugger to my computer's envionment PATH,I can succeed in debugging my program, so I just want to know why I can't use the setting "cmake.debugConfig"
when I use mingw,this question still exsits, only I add their path to computer's envionment PATH, it can work.
CMake Tools Diagnostics
No response
Debug Log
No response
Additional Information
No response
This doesn't look like a valid path: JetBrains/CLion 2022.2/bin/gdb/win/bin/gdb.exe
On Windows the path should start with a drive letter like C:/.
My guess is that CLion was installed into your Program Files folder, so the full path would be something like: C:/Program Files/JetBrains/CLion 2022.2/bin/gdb/win/bin/gdb.exe.
This might also work: ${env:ProgramFiles}/JetBrains/CLion 2022.2/bin/gdb/win/bin/gdb.exe
This issue has been closed automatically because it's labeled as a 'question' and has not had recent activity.