From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22837 invoked by alias); 7 May 2004 23:31:16 -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 22830 invoked from network); 7 May 2004 23:31:15 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 7 May 2004 23:31:15 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.10/8.12.10) with ESMTP id i47NVF0m010027 for ; Fri, 7 May 2004 19:31:15 -0400 Received: from pobox.toronto.redhat.com (pobox.toronto.redhat.com [172.16.14.4]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id i47NVEv28135; Fri, 7 May 2004 19:31:15 -0400 Received: from [172.16.14.107] (to-dhcp7.toronto.redhat.com [172.16.14.107]) by pobox.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id i47NVEcU014837; Fri, 7 May 2004 19:31:14 -0400 Message-ID: <409C1C42.2010908@redhat.com> Date: Fri, 07 May 2004 23:31:00 -0000 From: Bryce McKinlay User-Agent: Mozilla Thunderbird 0.5 (X11/20040502) MIME-Version: 1.0 To: Jim Blandy CC: Daniel Jacobowitz , gdb-patches@sources.redhat.com Subject: Re: Patch: DWARF2 location lists vs. shared libraries References: <40983940.3050003@redhat.com> <20040505040344.GA28793@nevyn.them.org> In-Reply-To: Content-Type: multipart/mixed; boundary="------------050002020902040509010508" X-SW-Source: 2004-05/txt/msg00229.txt.bz2 This is a multi-part message in MIME format. --------------050002020902040509010508 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-length: 466 How about this? Regards Bryce Jim Blandy wrote: >>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. >> >> >Yes, that's the approach I'd prefer, too. I wish we could apply it to >symbols as well, but I don't see how to pull that off. > > --------------050002020902040509010508 Content-Type: text/x-patch; name="gdb-loclist-2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="gdb-loclist-2.patch" Content-length: 1090 2004-05-07 Bryce McKinlay * dwarf2loc.c (find_location_expression): Use ANOFFSET to adjust base_address for shared libraries. Index: dwarf2loc.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2loc.c,v retrieving revision 1.14 diff -u -r1.14 dwarf2loc.c --- dwarf2loc.c 26 Jan 2004 20:36:31 -0000 1.14 +++ dwarf2loc.c 7 May 2004 23:22:16 -0000 @@ -53,11 +53,14 @@ find_location_expression (struct dwarf2_loclist_baton *baton, size_t *locexpr_length, CORE_ADDR pc) { - CORE_ADDR base_address = baton->base_address; CORE_ADDR low, high; char *loc_ptr, *buf_end; unsigned int addr_size = TARGET_ADDR_BIT / TARGET_CHAR_BIT, length; CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); + /* Adjust base_address for relocatable objects. */ + CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets, + SECT_OFF_TEXT (baton->objfile)); + CORE_ADDR base_address = baton->base_address + base_offset; loc_ptr = baton->data; buf_end = baton->data + baton->size; --------------050002020902040509010508--