From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28110 invoked by alias); 11 Oct 2004 19:21:52 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 28091 invoked from network); 11 Oct 2004 19:21:51 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 11 Oct 2004 19:21:51 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CH5jt-0003K2-3O; Mon, 11 Oct 2004 15:21:45 -0400 Date: Tue, 12 Oct 2004 06:57:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: kevinb@redhat.com, randolph@tausq.org, gdb@sources.redhat.com, libc-alpha@sources.redhat.com Subject: Re: Question about _dl_debug_state and new glibc Message-ID: <20041011192145.GA12678@nevyn.them.org> Mail-Followup-To: Mark Kettenis , kevinb@redhat.com, randolph@tausq.org, gdb@sources.redhat.com, libc-alpha@sources.redhat.com References: <20041011172207.GA14151@tausq.org> <20041011104647.6a03d9ce@saguaro> <20041011175524.GA29450@nevyn.them.org> <200410111913.i9BJDf3Q001081@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200410111913.i9BJDf3Q001081@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-10/txt/msg00290.txt.bz2 On Mon, Oct 11, 2004 at 09:13:41PM +0200, Mark Kettenis wrote: > Date: Mon, 11 Oct 2004 13:55:25 -0400 > From: Daniel Jacobowitz > > On Mon, Oct 11, 2004 at 10:46:47AM -0700, Kevin Buettner wrote: > > On Mon, 11 Oct 2004 10:22:07 -0700 > > Randolph Chung wrote: > > > > > I've been away from gdb for a bit, so hopefully this is not something > > > simple I missed while I've been away :) > > > > > > It appears that newer versions of glibc now marks the _dl_debug_state > > > function as hidden, making it not visible to gdb. This breaks the > > > solib tracking code in solib-svr4.c..... > > > > > > Looking at the docs, it looks like the "proper" way for gdb to do this > > > is to look up the r_debug symbol and use the r_brk member to locate > > > _dl_debug_state's address. is there any particular reason why we don't > > > do this in gdb? > > Only for static executables usually; for dynamic executables it's > supposed to be DT_DEBUG if that's available. Same difference. > > Hey wake up Daniel. Static executables don't have shared libraries. Oddly enough, in glibc they can - and often do. There's a static version of the runtime linker included, and things like dlopen work - and internal libc functionality like NSS (gethostname, etc.) and gconv use it. Also, there are architectures where DT_DEBUG is missing. I think MIPS may be one. Or maybe I'm misremembering this bit. > I suppose this is just something that has never been completely > implemented. Somehow I think the dynamic linker was supposed to trap > just after initializing r_debug and setting DT_DEBUG if it was being > traced, perhaps if it noticed that DT_DEBUG was set to some special > value by the debugger. Perhaps we'll know when "Open Solaris" is > released. Makes sense to me. Do any of the BSDs support using r_debug this way, or do they export _dl_debug_state also? > I see it hasn't been exported since March. Blech. > > So we should ask the glibc developers to unhide _dl_debug_state. I agree. -- Daniel Jacobowitz