Hi,
I have been using CodeBlocks for more than a year but I still can't use the debugger. Since it's the new decade I might as well finally solve this for good.
I looked at the -g -s flags, checked the path for spaces and even made a new project to test out debugging, but the debugger is still not working. I tried all I could find on the web.
Here is my debugger logs:
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\CodeBlocks_Projects\test-debug-2\
Adding source dir: C:\CodeBlocks_Projects\test-debug-2\
Adding file: C:\CodeBlocks_Projects\test-debug-2\bin\Debug\test-debug-2.exe
Changing directory to: C:/CodeBlocks_Projects/test-debug-2/.
Set variable: PATH=.;C:\cygwin64\bin;C:\cygwin64;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Program Files\Dell\DW WLAN Card;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;c:\Program Files\WIDCOMM\Bluetooth Software;c:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Windows\System32\OpenSSH;C:\go\bin;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Users\Chooi\AppData\Local\Microsoft\WindowsApps;C:\Users\Chooi\go\bin;C:\Users\Chooi\AppData\Roaming\npm;C:\Program Files\Sublime Text 3;C:\Users\Chooi\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\Chooi\AppData\Local\Programs\Python\Python37-32;C:\Users\Chooi\AppData\Local\Programs\Python\Python37-32\Scripts;C:\nuke
[debug]Command-line: C:\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet -args C:/CodeBlocks_Projects/test-debug-2/bin/Debug/test-debug-2.exe
[debug]Working dir : C:\CodeBlocks_Projects\test-debug-2
Starting debugger: C:\CodeBlocks\MinGW\bin\gdb32.exe -nx -fullname -quiet -args C:/CodeBlocks_Projects/test-debug-2/bin/Debug/test-debug-2.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Setting breakpoints
[debug]"C:/CodeBlocks_Projects/test-debug-2/bin/Debug/test-debug-2.exe": not in executable format: File format not recognized
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.9.1
[debug]Copyright (C) 2015 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. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]Type "show configuration" for configuration details.
[debug]For bug reporting instructions, please see:
[debug]<http://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) 7.9.1
[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 C:/CodeBlocks_Projects/test-debug-2/
[debug]Source directories searched: C:/CodeBlocks_Projects/test-debug-2;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/CodeBlocks_Projects/test-debug-2/Untitled2.cpp:44"
[debug]No symbol table is loaded. Use the "file" command.
[debug]Breakpoint 2 ("C:/CodeBlocks_Projects/test-debug-2/Untitled2.cpp:44") pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]No executable specified, use `target exec'.
[debug]Starting program:
[debug]>>>>>>cb_gdb:
Starting the debuggee failed: No executable specified, use `target exec'.
[debug]> quit
Debugger finished with status 0
Help is very much appreciated. Thanks!