我安装了gnu gcc的c编译器,当我安装代码块时,除了调试器外,一切都工作正常。程序甚至编译并运行,但调试器不会启动。
这是调试器选项卡中的消息。它以错误2结束。
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: D:\Projects\LearningC\
Adding source dir: D:\Projects\LearningC\
Adding file: D:\Projects\LearningC\bin\Debug\LearningC.exe
Changing directory to: D:/Projects/LearningC/.
Set variable: PATH=.;C:\cygwin64\bin;C:\cygwin64;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Users\aayus\AppData\Local\Microsoft\WindowsApps
[debug]Command-line: C:\cygwin64\bin\gdb.exe -nx -fullname -quiet -args D:/Projects/LearningC/bin/Debug/LearningC.exe
[debug]Working dir : D:\Projects\LearningC
Starting debugger: C:\cygwin64\bin\gdb.exe -nx -fullname -quiet -args D:/Projects/LearningC/bin/Debug/LearningC.exe
done
[debug]Reading symbols from D:/Projects/LearningC/bin/Debug/LearningC.exe...
[debug](gdb)
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]>>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) (Cygwin 10.2-1) 10.2
[debug]Copyright (C) 2021 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.
[debug]Type "show copying" and "show warranty" for details.
[debug]This GDB was configured as "x86_64-pc-cygwin".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<https://www.gnu.org/software/gdb/bugs/>.
[debug]Find the GDB manual and other documentation resources online at:
[debug] <http://www.gnu.org/software/gdb/documentation/>.
[debug]For help, type "help".
[debug]Type "apropos word" to search for commands related to "word".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) (Cygwin 10.2-1) 10.2
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 200
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> directory D:/Projects/LearningC/
[debug]Source directories searched: /cygdrive/d/Projects/LearningC/D:/Projects/LearningC:$cdir:$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Error creating process /cygdrive/d/Projects/LearningC/D:/Projects/LearningC/bin/Debug/LearningC.exe, (error 2).
[debug]Starting program: /cygdrive/d/Projects/LearningC/D:/Projects/LearningC/bin/Debug/LearningC.exe
[debug]>>>>>>cb_gdb:
Error creating process /cygdrive/d/Projects/LearningC/D:/Projects/LearningC/bin/Debug/LearningC.exe, (error 2).
[debug]> quit
Debugger finished with status 0
如果有人能帮助我,那就太好了。这只是一个简单的helloworld程序。
1条答案
按热度按时间dpiehjr41#
看起来问题出在最新的gdb版本上。我回到gdb 9. x,它工作得很好。