From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103359 invoked by alias); 5 Jun 2018 20:34:52 -0000 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 Received: (qmail 102447 invoked by uid 89); 5 Jun 2018 20:34:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=foreign X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Jun 2018 20:34:49 +0000 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D2BE93003BF7; Tue, 5 Jun 2018 20:34:48 +0000 (UTC) Received: from theo.uglyboxes.com (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 987B317003; Tue, 5 Jun 2018 20:34:48 +0000 (UTC) Subject: Re: [RFA 6/6] Make psymbols and psymtabs independent of the program space To: Tom Tromey , gdb-patches@sourceware.org References: <20180503223621.22544-1-tom@tromey.com> <20180503223621.22544-7-tom@tromey.com> From: Keith Seitz Message-ID: Date: Tue, 05 Jun 2018 20:34:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180503223621.22544-7-tom@tromey.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2018-06/txt/msg00117.txt.bz2 On 05/03/2018 03:36 PM, Tom Tromey wrote: > This patch finally makes partial symbols and partial symtabs > independent of the program space. > SHAZAM! I've looked over this patch, and I'd say go for it (warning IANAM), but I would like to bring up one or two general questions that came to mind. [A lot of this stuff is pretty foreign to me, so please pardon my ignorance.] > diff --git a/gdb/dbxread.c b/gdb/dbxread.c > index da675abb68..91bc25a87d 100644 > --- a/gdb/dbxread.c > +++ b/gdb/dbxread.c > @@ -2296,8 +2281,8 @@ read_ofile_symtab (struct objfile *objfile, struct partial_symtab *pst) > > sym_offset = LDSYMOFF (pst); > sym_size = LDSYMLEN (pst); > - text_offset = PSYMTAB_TEXTLOW (pst); > - text_size = PSYMTAB_TEXTHIGH (pst) - PSYMTAB_TEXTLOW (pst); > + text_offset = PSYMTAB_TEXTLOW (objfile, pst); > + text_size = PSYMTAB_TEXTHIGH (objfile, pst) - PSYMTAB_TEXTLOW (objfile, pst); > section_offsets = objfile->section_offsets; IIUC, text_offset can be computed using the RAW flavors since both macros simply add ANOFFSET (...). [Compilers are probably smart enough to optimize this, so take this with a grain of salt. Or a block of salt lick.] > diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c > index 3cb0475b3b..f8630de47a 100644 > --- a/gdb/dwarf2read.c > +++ b/gdb/dwarf2read.c > @@ -3178,8 +3178,8 @@ create_addrmap_from_index (struct dwarf2_per_objfile *dwarf2_per_objfile, > continue; > } > > - lo = gdbarch_adjust_dwarf2_addr (gdbarch, lo + baseaddr); > - hi = gdbarch_adjust_dwarf2_addr (gdbarch, hi + baseaddr); > + lo = gdbarch_adjust_dwarf2_addr (gdbarch, lo + baseaddr) - baseaddr; > + hi = gdbarch_adjust_dwarf2_addr (gdbarch, hi + baseaddr) - baseaddr; > addrmap_set_empty (mutable_map, lo, hi - 1, > dwarf2_per_objfile->get_cu (cu_index)); > } I have to admit... The above expressions look odd, but I am completely unfamiliar with gdbarch_adjust_dwarf2_addr. From the description of that function, it seems that this is okay, though. Keith