gdb - loading symbols of shared library

Sun Oct 12 12:58:00 GMT 2008

I am debugging in gdb a program that dynamically loads I want
to debug the code from libodbcinst - I can break in it, see the source and
step through it, but whenever I try printing a variable, I get (e.g. for the
variable ret):
"No symbol "ret" in current context."

In my program loads my own library (an odbc driver). This
library I can debug fully, symbols and all.
Things I've verified:
- is compiled with debug information. I compiled it myself
from UnixODBC sources, and made sure it was compiled with debug info.
- is not stripped - I ran 'nm' on it, and got a symbol table.
- From gdb I ran 'info share' and saw that was in the list of
loaded libraries. I also tried running 'sharedlibrary' but
this made no difference.
- I tried running add-symbol-file for the library. I must admit I have a
problem here. This command is supposed to receive an 'address' parameter.
The manual says this should be the address where the library was loaded. How
do I know that library? I tried putting different things there - for example
the address of the text segment I got from 'maint info sections', but not
only could I still not see the symbols, this also screwed up something with
the rest of the debugging.

So, in addition to a solution to show the symbols, I would also be very
grateful for an explanation of the address parameter for add-symbol-file.

I'm working on HP-UX 11.23 (Itanium). Using HP gdb (wdb) 5.7 .


View this message in context:
Sent from the Sourceware - gdb list mailing list archive at

More information about the Gdb mailing list