User forums > Help
[SOLVED]Help using debugger
Quagmire:
Hello
I am a newbie in Code Blocks (and programming), and I really like it and would like to use it as much as I can. The only problem is I can't run the debugger
in the latest build. I don't seem to have any problems with this with version 10.05 (I was using this, because of the college).
In short, I want to execute code line by line and to watch the variables. I read the manual maybe about a thousand times, I searched for almost a week,
and I still cannot do this. Can someone please explain me how to do it?
I compile the project with -g and -Wall, add some breakpoints and press the debugger start button. And then, the debugger just exits with this message:
Starting the debuggee failed: No symbol table loaded. Use the "file" command.
[debug]> quit
Debugger finished with status 0
I know that I'm doing something wrong here. Please help me see it :)
Boris
oBFusCATed:
Enable full log for the compiler and verify that you're correctly using -g and there no -s options in the log.
Quagmire:
This is the build log:
-------------- Clean: Debug in newpr (compiler: GNU GCC Compiler)---------------
Cleaned "newpr - Debug"
-------------- Build: Debug in newpr (compiler: GNU GCC Compiler)---------------
mingw32-gcc.exe -Wall -g -Wall -g -c "C:\Users\Stewie\Desktop\c primer\newpr\main.c" -o obj\Debug\main.o
mingw32-g++.exe -o bin\Debug\newpr.exe obj\Debug\main.o
Output size is 82.55 KB
Process terminated with status 0 (0 minutes, 3 seconds)
0 errors, 0 warnings (0 minutes, 3 seconds)
And this is the debugger:
[debug]Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Stewie/Desktop/CPRIME~1/newpr/bin/Debug/newpr.exe
[debug]Working dir : C:\Users\Stewie\Desktop\CPRIME~1\newpr
Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet -args C:/Users/Stewie/Desktop/CPRIME~1/newpr/bin/Debug/newpr.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]"C:/Users/Stewie/Desktop/CPRIME~1/newpr/bin/Debug/newpr.exe": not in executable format: File format not recognized
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb 6.8
[debug]Copyright (C) 2008 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 "i686-pc-mingw32".
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb 6.8
[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 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]>>>>>>cb_gdb:
[debug]> source C:\Users\Stewie\Desktop\CB_20121123_rev8598_win32(1)\CB_20121123_rev8598_win32(2)\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]Function "__cxa_throw" not defined in loaded symbols.
[debug]>>>>>>cb_gdb:
[debug]> -g
[debug]Undefined command: "-g". Try "help".
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/Stewie/Desktop/CPRIME~1/newpr/
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:6"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 1 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:6) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:7"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 2 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:7) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:8"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 3 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:8) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:9"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 4 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:9) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:10"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 5 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:10) pending.
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/Stewie/Desktop/c primer/newpr/main.c:11"
[debug]No source file named C:/Users/Stewie/Desktop/c primer/newpr/main.c in loaded symbols.
[debug]Breakpoint 6 ("C:/Users/Stewie/Desktop/c primer/newpr/main.c:11) pending.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]No executable specified, use `target exec'.
[debug]>>>>>>cb_gdb:
Starting the debuggee failed: No executable specified, use `target exec'.
[debug]> quit
Debugger finished with status 0
These are the logs. I am really lost here, so any help would be greatly appreciated.
Jenna:
Try it in a path without spaces (and special characters).
You should also thinkabout updating your compiler suite, as gdb 6.8 is quiet old.
Quagmire:
--- Quote from: jens on December 05, 2012, 09:38:02 am ---Try it in a path without spaces (and special characters).
You should also thinkabout updating your compiler suite, as gdb 6.8 is quiet old.
--- End quote ---
That did the trick. Everything is working fine now.
Thanks a lot!
Navigation
[0] Message Index
[#] Next page
Go to full version