From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17801 invoked by alias); 12 Oct 2008 12:58:40 -0000 Received: (qmail 17792 invoked by uid 22791); 12 Oct 2008 12:58:39 -0000 X-Spam-Check-By: sourceware.org Received: from kuber.nabble.com (HELO kuber.nabble.com) (216.139.236.158) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sun, 12 Oct 2008 12:57:52 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1Kp0W5-0002lC-Vv for gdb@sourceware.org; Sun, 12 Oct 2008 05:57:49 -0700 Message-ID: <19941465.post@talk.nabble.com> Date: Sun, 12 Oct 2008 12:58:00 -0000 From: rimon To: gdb@sourceware.org Subject: gdb - loading symbols of shared library MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: rorni@yahoo.com X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00049.txt.bz2 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 . TIA! RO -- View this message in context: http://www.nabble.com/gdb---loading-symbols-of-shared-library-tp19941465p19941465.html Sent from the Sourceware - gdb list mailing list archive at Nabble.com.