From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6525 invoked by alias); 23 May 2006 22:11:21 -0000 Received: (qmail 6468 invoked by uid 22791); 23 May 2006 22:11:20 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 23 May 2006 22:11:18 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1Fif5u-0002Cm-Bz; Tue, 23 May 2006 18:11:14 -0400 Date: Tue, 23 May 2006 23:02:00 -0000 From: Daniel Jacobowitz To: PAUL GILLIAM Cc: gdb@sources.redhat.com Subject: Re: Chicken-or-egg problem with shared libraries Message-ID: <20060523221114.GA8445@nevyn.them.org> Mail-Followup-To: PAUL GILLIAM , gdb@sources.redhat.com References: <1148418266.315.45.camel@dufur.beaverton.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1148418266.315.45.camel@dufur.beaverton.ibm.com> User-Agent: Mutt/1.5.11+cvs20060403 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-05/txt/msg00339.txt.bz2 On Tue, May 23, 2006 at 02:04:26PM -0700, PAUL GILLIAM wrote: > In solib-svr4.c (enable_break), GDB tries to set a breakpoint in the > dynamic loader (at "_dl_debug_state") so that shared objects can be > tracked as they are loaded and unloaded. > > The problem (on gnu/linux PowerPC64 at least) is that the dynamic loader > is it's self a shared object and its minimal symbols are not loaded when > "enable_break" is called. > > I have two ideas for fixing this: 1) pre-load the dynamic loaders > minimal symbols so that when "enable_break()" is called, > "_dl_debug_state" will be found and all is well and 2) allow > "enable_break()" to set a pending breakpoint. I don't think you really understand the problem you're trying to fix - what is it, by the way? Is it related to Alan's comment earlier about the function descriptor lookup? Here's how it works today: bfd_get_section_contents (exec_bfd, interp_sect, buf, 0, interp_sect_size); tmp_fd = solib_open (buf, &tmp_pathname); if (tmp_fd >= 0) tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd); sym_addr = bfd_lookup_symbol (tmp_bfd, *bkpt_namep, SEC_CODE); if (sym_addr != 0) break; -- Daniel Jacobowitz CodeSourcery