0

I am trying to debug my C code on CodeBlocks with GDB Debugger. Unfortunately It does not work, I've tried almost everything including uninstall and re install CodeBlocks (debugger included). Here's down below I'll put the exit error so you can get way better where the problem is:

Active debugger config: GDB/CDB debugger:Default 
Building to ensure sources are up-to-date
Selecting target:  
Release 
Adding source dir: D:\20201105_es8_randomWalk\ 
Adding source dir: D:\20201105_es8_randomWalk\ 
Adding file: D:\20201105_es8_randomWalk\bin\Release\20201105_es8_randomWalk.exe
Changing directory to: D:/20201105_es8_randomWalk/. 
Set variable: PATH=.;D:\programms\CodeBlocks\MinGW\bin;D:\programms\CodeBlocks\MinGW;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Users\pnmat\AppData\Local\Microsoft\WindowsApps
Starting debugger: D:\programms\CodeBlocks\MinGW\bin\gdb.exe -nx -fullname -quiet  -args D:/20201105_es8_randomWalk/bin/Release/20201105_es8_randomWalk.exe
done
Setting breakpoints 
Reading symbols from D:/20201105_es8_randomWalk/bin/Release/20201105_es8_randomWalk.exe...(no debugging symbols found)...done. 
Debugger name and version: GNU gdb (GDB) 8.1 
No symbol table is loaded.  Use the "file" command.
Temporary breakpoint 3 ("D:/20201105_es8_randomWalk/main.c:23") pending. 
Child process PID: 8516 [Inferior 1 (process 8516) exited normally] 
Debugger finished with status 0

It seems like it does not hit any breakpoint I've inserted in the code.

panini
  • 13
  • 8
  • 3
    _No symbol table is loaded._ -> Compile with `-g` flag on, and `gcc` is not a debugger, you mean `gdb` – David Ranieri Nov 06 '20 at 09:34
  • Yes, I am sorry I meant 'gdb'. Could you please tell me what do you mean with -g flag on? Thank you very much – panini Nov 06 '20 at 09:41
  • Hi @matthw, the `-g` flag generates debug information to be used by the debugger, this will solve your issue: http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks#Build_debug_version_of_your_project – David Ranieri Nov 06 '20 at 09:47
  • Unfortunately the flag was already on. Still not working – panini Nov 06 '20 at 09:52
  • That's odd, try cleaning and rebuilding the whole project, you can also try to run `gdb` manually outside Codeblocks launching `gdb your_program` from the console in your working directory. – David Ranieri Nov 06 '20 at 10:00
  • I've tryed several projects and no one did work. I am very stucked on that – panini Nov 06 '20 at 10:25
  • Do you have "Strip all symbols" enabled? Do you use non ASCII symbols in project paths? – ks1322 Nov 06 '20 at 15:07
  • Sorry could you please tell me where I can find "Strip all symbols" pls? I checked build option section but unable to find it. – panini Nov 06 '20 at 15:26
  • It should be somewhere near "Produce debugging symbols" in "Compiler Flags" tab: http://wiki.codeblocks.org/index.php/Debugging_with_Code::Blocks#Build_debug_version_of_your_project. See also related question https://stackoverflow.com/q/5458854/72178. – ks1322 Nov 06 '20 at 16:26
  • I hadn't it turned on. I've tryed to switch it to on but nothing has changed. I actually do not know what else I could do. – panini Nov 07 '20 at 17:30

0 Answers0