From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24027 invoked by alias); 11 Oct 2004 19:16:20 -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 24016 invoked from network); 11 Oct 2004 19:16:19 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 11 Oct 2004 19:16:19 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.10) with ESMTP id i9BJGJan002632 for ; Mon, 11 Oct 2004 15:16:19 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i9BJGJr13927; Mon, 11 Oct 2004 15:16:19 -0400 Received: from localhost.localdomain (vpn50-43.rdu.redhat.com [172.16.50.43]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id i9BJGIQ7009355; Mon, 11 Oct 2004 15:16:18 -0400 Received: from saguaro (saguaro.lan [192.168.64.2]) by localhost.localdomain (8.12.11/8.12.10) with SMTP id i9BJGD4Q027507; Mon, 11 Oct 2004 12:16:13 -0700 Date: Mon, 11 Oct 2004 22:00:00 -0000 From: Kevin Buettner To: Daniel Jacobowitz Cc: Randolph Chung , gdb@sources.redhat.com Subject: Re: Question about _dl_debug_state and new glibc Message-Id: <20041011121612.02dd4495@saguaro> In-Reply-To: <20041011175524.GA29450@nevyn.them.org> References: <20041011172207.GA14151@tausq.org> <20041011104647.6a03d9ce@saguaro> <20041011175524.GA29450@nevyn.them.org> Organization: Red Hat Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00289.txt.bz2 On Mon, 11 Oct 2004 13:55:25 -0400 Daniel Jacobowitz wrote: > On Mon, Oct 11, 2004 at 10:46:47AM -0700, Kevin Buettner wrote: > > > 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? Ah! Perhaps that's the reason why _dl_debug_state was used directly. I ran into this problem when I wrote the FR-V's solib code. (Due to the fact that text and data are independetly relocated, the code in solib-svr4.c couldn't be used.) The symbol in question was not exported and could only be accessed from the r_debug struct. But as you say, it's value wasn't immediately available. So, we set the solib event breakpoint on the executable's entry point (probably _start). Once this breakpoint was hit, the data structures in question had been initialized, and so we reset it to the address determined by examining the r_debug struct. I suspect that a similar strategy could be used for solib-svr4.c. Kevin