LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   gdb breakpoint doesnt work? (https://www.linuxquestions.org/questions/programming-9/gdb-breakpoint-doesnt-work-368056/)

Thinking 09-29-2005 04:06 AM

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

Hko 09-29-2005 04:25 AM

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"

Thinking 09-29-2005 05:15 AM

good point
but it doesn't seem to work neither changing proxy.hpp to proxy.cpp nor the directory command

addy86 09-29-2005 06:36 AM

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


All times are GMT -5. The time now is 06:27 AM.