From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 699 invoked by alias); 9 Feb 2006 05:54:41 -0000 Received: (qmail 691 invoked by uid 22791); 9 Feb 2006 05:54:40 -0000 X-Spam-Check-By: sourceware.org Received: from zproxy.gmail.com (HELO zproxy.gmail.com) (64.233.162.197) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 09 Feb 2006 05:54:39 +0000 Received: by zproxy.gmail.com with SMTP id x3so90401nzd for ; Wed, 08 Feb 2006 21:54:36 -0800 (PST) Received: by 10.36.222.39 with SMTP id u39mr5997983nzg; Wed, 08 Feb 2006 21:54:35 -0800 (PST) Received: by 10.37.2.63 with HTTP; Wed, 8 Feb 2006 21:54:35 -0800 (PST) Message-ID: <8f2776cb0602082154q7613a808ha4cff5fa6bbf382b@mail.gmail.com> Date: Thu, 09 Feb 2006 05:54:00 -0000 From: Jim Blandy To: Patrick Alken Subject: Re: gdb and shared libraries Cc: gdb@sourceware.org In-Reply-To: <20060208211332.GA8676@hippogriff.physics.drexel.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20060208211332.GA8676@hippogriff.physics.drexel.edu> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-02/txt/msg00057.txt.bz2 On 2/8/06, Patrick Alken wrote: > So it is step #4 that I am hoping someone on the list can give me > details for. How do you know when all the libraries have been loaded > so that you can stop execution of the program while you load > the libs symbol tables? How do you get the pathnames of the libraries > after they have been loaded so you can mmap them? Well, each time it loads a shared library, the dynamic linker calls a specific function (I think it's _dl_debug_state on Linux), and there is a designated data structure for you to walk to find the current list of shlibs. See solib.c and solib-svr4.c. But I can't remember, nor can I Google, where this stuff is documented. I guess we're just depending on undocumented behavior (on Linux, at least). But the whole reason it's there is to help out the debugger, so I don't know why it'd be undocumented.