From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25971 invoked by alias); 5 May 2004 04:03:48 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25962 invoked from network); 5 May 2004 04:03:45 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 5 May 2004 04:03:45 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BLDdI-0007WV-Ue; Wed, 05 May 2004 00:03:45 -0400 Date: Wed, 05 May 2004 04:03:00 -0000 From: Daniel Jacobowitz To: Bryce McKinlay Cc: gdb-patches@sources.redhat.com Subject: Re: Patch: DWARF2 location lists vs. shared libraries Message-ID: <20040505040344.GA28793@nevyn.them.org> Mail-Followup-To: Bryce McKinlay , gdb-patches@sources.redhat.com References: <40983940.3050003@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40983940.3050003@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-05/txt/msg00129.txt.bz2 On Tue, May 04, 2004 at 08:45:52PM -0400, Bryce McKinlay wrote: > 2004-05-04 Bryce McKinlay > > * dwarf2read.c (dwarf2_symbol_mark_computed): Use ANOFFSET to > adjust baton's base_address for shared libraries. I spoke briefly to Bryce about this (on IRC). I think the right thing to do would be to add the offset when searching, rather than when saving. This will help us with relocating objfiles, which I think would be good to support - that way we can cache debug info for unchanged shared libraries across runs. Does this make sense to others? I'll try to write the patch tomorrow or Thursday. > > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.150 > diff -u -r1.150 dwarf2read.c > --- dwarf2read.c 4 May 2004 00:11:25 -0000 1.150 > +++ dwarf2read.c 5 May 2004 00:41:00 -0000 > @@ -8662,6 +8662,7 @@ > if (attr->form == DW_FORM_data4 || attr->form == DW_FORM_data8) > { > struct dwarf2_loclist_baton *baton; > + CORE_ADDR base_offset; > > baton = obstack_alloc (&cu->objfile->objfile_obstack, > sizeof (struct dwarf2_loclist_baton)); > @@ -8671,7 +8672,10 @@ > don't run off the edge of the section. */ > baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr); > baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr); > - baton->base_address = cu->header.base_address; > + /* Set base_address, adjusting for shared libraries. */ > + base_offset = ANOFFSET (cu->objfile->section_offsets, > + SECT_OFF_TEXT (cu->objfile)); > + baton->base_address = cu->header.base_address + base_offset; > if (cu->header.base_known == 0) > complaint (&symfile_complaints, > "Location list used without specifying the CU base address."); -- Daniel Jacobowitz