Unix/Linux Go Back    

Programming Post questions about C, C++, Java, SQL, and other programming languages here.

gdb - loading symbols of shared library


Thread Tools Search this Thread Display Modes
Old Unix and Linux 10-12-2008   -   Original Discussion by rimon
rimon rimon is offline
Registered User
Join Date: Oct 2007
Last Activity: 12 October 2008, 7:02 AM EDT
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
gdb - loading symbols of shared library

I am debugging in gdb a program that dynamically loads libodbcinst.so. 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 libodbcinst.so loads my own library (an odbc driver). This library I can debug fully, symbols and all.
Things I've verified:
- libodbcinst.so is compiled with debug information. I compiled it myself from UnixODBC sources, and made sure it was compiled with debug info.
- libodcinst.so is not stripped - I ran 'nm' on it, and got a symbol table.
- From gdb I ran 'info share' and saw that libodbcinst.so was in the list of loaded libraries. I also tried running 'sharedlibrary libodbcinst.so' 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 .


Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Linux More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Loading a shared library in AIX user_guest AIX 1 01-28-2011 04:41 PM
Loading the shared library I want manustone Programming 2 07-26-2010 12:16 PM
How to change a Makefile from building static library to shared library? cpthk Shell Programming and Scripting 1 08-26-2009 03:23 AM
RHEL5 reboot - error loading shared library c00kie88 Red Hat 0 06-04-2009 11:14 PM
Loading shared Libraries dynamically Debasisb2002 HP-UX 1 03-03-2005 08:48 AM

All times are GMT -4. The time now is 12:12 PM.