Author Topic: GDB problem  (Read 7507 times)

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
GDB problem
« on: December 19, 2007, 05:29:42 am »
hi,

i try to debug my app. I set the checkmark in my debug-target for creating debugging symbols.

But i cant add watches and when hitting F8 no of my breakpoints are recongnized (always printing "(no debugging symbols)" )

greetings,
Halan

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: GDB problem
« Reply #1 on: December 19, 2007, 06:08:20 am »
(always printing "(no debugging symbols)" )
That is the best hint you could get: Possible you have forgotten to enable the "-g" switch for the compiler to ensure debugging symbols are being created?!
In anyway - have a look at my sig for more information.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: GDB problem
« Reply #2 on: December 19, 2007, 11:40:52 pm »
i followed your tutorial already before and have the check set

also it says

Debugger name and version: GNU gdb 6.6-debian

so it reconizes my debugger (im using ubuntu btw)
but still i cant add watches nor does it recognize my breakpoints.

i added a second target for debugging btw and selected it for compiling

greetings,
Halan

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: GDB problem
« Reply #3 on: December 20, 2007, 08:00:08 am »
but still i cant add watches nor does it recognize my breakpoints.
Did you set BP's in constructors, maybe?
I guess it's best if you compile a small example that demonstrates this and put it here in the forum for inspection. Don't forget to include the project file.
With regards, Morten.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: GDB problem
« Reply #4 on: December 20, 2007, 08:28:50 am »
If you create a console project with the wizard, it should be possible to set breakpoints at any line and to make gdb stop there.

Have you the "Debugger (debug)" tab visible in the log area ?

If not you can turn it on by checking "Display debugger's log" in "Settings -> Compiler and debugger settings -> Debugger settings".

Then you can see the commandline gdb is started with and the commands send to the gdb session by thge debugger plugin.
And of course gdb's answers.

This might help to find the cause for your problems.

Offline Halan

  • Multiple posting newcomer
  • *
  • Posts: 43
Re: GDB problem
« Reply #5 on: December 22, 2007, 04:38:06 am »
LD_LIBRARY_PATH=.:
Command-line: /usr/bin/gdb -nx -fullname  -quiet -args bin/Debug/MapEditor
Working dir : /home/kai/Desktop/Coding/ProjectFreedom/MapEditor/
> set prompt >>>>>>cb_gdb:
Executing: xterm -T 'Program Console' -e sleep 87866
Executing: ps x -o tty,pid,command
(no debugging symbols found)
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) >>>>>>cb_gdb:
> show version
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
>>>>>>cb_gdb:
> set confirm off
>>>>>>cb_gdb:
> set width 0
>>>>>>cb_gdb:
> set height 0
PS result: ?         8083 ps x -o tty,pid,command
PS result: pts/0     8082 sleep 87866
TTY is[/dev/pts/0]
GetConsoleTTY[/dev/pts/0]ConsolePid[8081]
Queued:[tty /dev/pts/0]
>>>>>>cb_gdb:
> set breakpoint pending on
>>>>>>cb_gdb:
> set print asm-demangle on
>>>>>>cb_gdb:
> set unwindonsignal on
>>>>>>cb_gdb:
> set disassembly-flavor intel
>>>>>>cb_gdb:
> directory /home/kai/Desktop/Coding/ProjectFreedom/MapEditor/
>>>>>>cb_gdb:
> directory /home/kai/Desktop/Coding/ProjectFreedom/
>>>>>>cb_gdb:
> tty /dev/pts/0
>>>>>>cb_gdb:
> start
Function "main" not defined.
Breakpoint 1 (main) pending.
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1213200704 (LWP 8084)]
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
Program exited with code 0377.
>>>>>>cb_gdb:
> quit

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: GDB problem
« Reply #6 on: December 22, 2007, 10:14:20 am »
Which version of C::B do you use ?
Can you post (or mail me) the project-file (*.cbp) and the "default.conf" ?
You find "default.conf" in "$HOME/.codeblocks".

AsM0DeUz

  • Guest
Re: GDB problem
« Reply #7 on: December 24, 2007, 11:08:28 am »
Hi !

You probably have the same issue i had 'till today  :) If you create a new file (File - New - File ...) you won't be able to debug anything but if you create a project (File - New - Project ...) all grayed actions in debug menu will be available.

Regards