From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22216 invoked by alias); 11 Oct 2004 19:14:07 -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 22201 invoked from network); 11 Oct 2004 19:14:06 -0000 Received: from unknown (HELO walton.sibelius.xs4all.nl) (82.92.89.47) by sourceware.org with SMTP; 11 Oct 2004 19:14:06 -0000 Received: from elgar.sibelius.xs4all.nl (elgar.sibelius.xs4all.nl [192.168.0.2]) by walton.sibelius.xs4all.nl (8.13.0/8.13.0) with ESMTP id i9BJDiXc024323; Mon, 11 Oct 2004 21:13:44 +0200 (CEST) Received: from elgar.sibelius.xs4all.nl (localhost [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6) with ESMTP id i9BJDh2j001086; Mon, 11 Oct 2004 21:13:43 +0200 (CEST) (envelope-from kettenis@elgar.sibelius.xs4all.nl) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.12.6p3/8.12.6/Submit) id i9BJDf3Q001081; Mon, 11 Oct 2004 21:13:41 +0200 (CEST) Date: Mon, 11 Oct 2004 20:47:00 -0000 Message-Id: <200410111913.i9BJDf3Q001081@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: drow@false.org CC: kevinb@redhat.com, randolph@tausq.org, gdb@sources.redhat.com, libc-alpha@sources.redhat.com In-reply-to: <20041011175524.GA29450@nevyn.them.org> (message from Daniel Jacobowitz on Mon, 11 Oct 2004 13:55:25 -0400) Subject: Re: Question about _dl_debug_state and new glibc References: <20041011172207.GA14151@tausq.org> <20041011104647.6a03d9ce@saguaro> <20041011175524.GA29450@nevyn.them.org> X-SW-Source: 2004-10/txt/msg00288.txt.bz2 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. > I can't think of any reason. I'm guessing that it was more expedient > for the original authors of the code to do it the way it was done. > In any case, I know of no reason not to change it so that it's done > "properly". We set the breakpoint on _dl_debug_state before starting the inferior. _dl_debug_initialize initializes _r_debug somewhat later... I'm not sure how it is supposed to be used. Do either of you know? The problem is that even DT_DEBUG isn't initialized before initialization of the dynamic linker. Theoretically, we could put a watchpoint on DT_DEBUG, and lookup r_brk if it triggers. However, I don't think that's very practical on platforms without hardware watchpoint support. 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. I see it hasn't been exported since March. Blech. So we should ask the glibc developers to unhide _dl_debug_state. Mark