From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19995 invoked by alias); 12 Jul 2010 21:22:18 -0000 Received: (qmail 19981 invoked by uid 22791); 12 Jul 2010 21:22:17 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_BJ,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 12 Jul 2010 21:22:12 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6CLMA76021825 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 12 Jul 2010 17:22:10 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6CLM8tw003531 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Jul 2010 17:22:09 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o6CLM8Ti012827; Mon, 12 Jul 2010 23:22:08 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o6CLM74Q012815; Mon, 12 Jul 2010 23:22:07 +0200 Date: Mon, 12 Jul 2010 21:22:00 -0000 From: Jan Kratochvil To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFC: fix bug when debugging prelink'd library Message-ID: <20100712212207.GA12165@host0.dyn.jankratochvil.net> References: <20100712194738.GA6846@host0.dyn.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00219.txt.bz2 On Mon, 12 Jul 2010 23:06:21 +0200, Tom Tromey wrote: > >>>>> "Tom" == Tom Tromey writes: > > Tom> It does mean we need 3 new accessors, which is ugly. OTOH, I found > Tom> that we use the objfile's name in locexpr_describe_location_piece, > Tom> and there I think we also want the master objfile. > > We only need 1 new accessor -- using the master objfile is ok for the > other uses. Yes, I like the patch this way. Thanks, Jan > --- a/gdb/dwarf2loc.h > +++ b/gdb/dwarf2loc.h > -/* Return the OBJFILE associated with the compilation unit CU. */ > +/* Return the OBJFILE associated with the compilation unit CU. If CU > + came from a separate debuginfo file, then the master objfile is > + returned. */ > struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu); The same comment needs to be updated at the function definition in dwarf2read.c. > +/* Return the text offset for CU. */ > +CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu); + > +/* Return the text offset of the CU. */ Suggesting to extend the comment: This returned offset is specific to this CU's debug info objfile and it may be different from the SEPARATE_DEBUG_OBJFILE_BACKLINK objfile offsets. > +CORE_ADDR > +dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu) > +{ > + struct objfile *objfile = per_cu->psymtab->objfile; > + > + return ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); > +}