LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-29-2005, 04:06 AM   #1
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Rep: Reputation: 30
gdb breakpoint doesnt work?


hiho@ll

i have a library which is loaded by my daemon process
the library starts a server and the server runs a few threads
i want to debug those threads

the threads are defined by proxy.hpp file

if i compile the stuff with
-g -ggdb -g3 -ggdb3
and do
Code:
gdb ./myprog
break proxy.hpp:120
No source file named proxy.hpp.
Make breakpoint pending on future shared library load? (y or [n]) y
run -c ./server.cfg

....
it doesn't break!
it's like no debugger is running

Q1: why doesn't gdb recognize my source files?
it only knows about the main source file
but the source files of the librarys loaded aren't recognized
Q2: if gdb asks for setting the breakpoint in future depending on shared libraries (which i'm using!) why it doesn't break on my breakpoint proxy.hpp:120?
Q3: maybe i have to use different compile flags?

btw. i'm compiling the libraries and the main prog with the flags
and i tried only the flag -g
but i got the same

i'm using GNU gdb 6.3

thx@ll
 
Old 09-29-2005, 04:25 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 111Reputation: 111
Quote:
Code:
gdb ./myprog
break proxy.hpp:120
No source file named proxy.hpp.
It's unusual to have executable code in a header file (.hpp). I may well be wrong about this, but I think gdb doesn't consider header files as valid sources.

Also, maybe gdb cannot find the sources for the shared lib. You can specify where gdb should look for sources. See:
Code:
bash$ info gdb "Source" "Source Path"
 
Old 09-29-2005, 05:15 AM   #3
Thinking
Member
 
Registered: Oct 2003
Posts: 249

Original Poster
Rep: Reputation: 30
good point
but it doesn't seem to work neither changing proxy.hpp to proxy.cpp nor the directory command
 
Old 09-29-2005, 06:36 AM   #4
addy86
Member
 
Registered: Nov 2004
Location: Germany
Distribution: Debian Testing
Posts: 332

Rep: Reputation: 31
Could you please post the source code lines surrounding proxy.hpp:120?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
normal gdb and spec gdb for kgdb Igor007 Programming 1 09-23-2005 04:15 PM
normal gdb and spec gdb for kgdb Igor007 Linux - Newbie 1 09-23-2005 01:41 PM
Why doesnt my USB mouse doesnt work? barkha Linux - Hardware 2 08-16-2005 11:31 AM
gdb .. looking for 32 bit gdb.. for ia64 suse.. nkshirsagar SUSE / openSUSE 0 12-09-2004 03:02 AM
gas and gdb - breakpoint not "breaking" prell Programming 3 07-30-2004 06:32 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration