From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 102769 invoked by alias); 8 Aug 2019 18:04:22 -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 102760 invoked by uid 89); 8 Aug 2019 18:04:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-4.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.1 spammy= 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; Thu, 08 Aug 2019 18:04:20 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70E3B30C2432; Thu, 8 Aug 2019 18:04:19 +0000 (UTC) Received: from f29-4.lan (ovpn-117-6.phx2.redhat.com [10.3.117.6]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3A0931001938; Thu, 8 Aug 2019 18:04:19 +0000 (UTC) Date: Thu, 08 Aug 2019 18:04:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Tom Tromey , Tom de Vries Subject: Re: [PATCH][gdb] Fix gdb.dwarf2/varval.exp with -fPIE/-pie Message-ID: <20190808110418.378470a7@f29-4.lan> In-Reply-To: <87h86r60hv.fsf@tromey.com> References: <20190808124907.GA19791@delia> <87h86r60hv.fsf@tromey.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00209.txt.bz2 On Thu, 08 Aug 2019 11:16:44 -0600 Tom Tromey wrote: > >>>>> "Tom" == Tom de Vries writes: > > Thanks for the patch. > > Tom> + CORE_ADDR baseaddr > Tom> + = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); > Tom> + struct gdbarch *gdbarch = get_objfile_arch (objfile); > > Tom> for (const auto &cand_off > Tom> : dwarf2_per_objfile->abstract_to_concrete[die->sect_off]) > Tom> @@ -23220,6 +23223,8 @@ dwarf2_fetch_die_loc_sect_off (sect_offset sect_off, > > Tom> CORE_ADDR pc_low, pc_high; > Tom> get_scope_pc_bounds (cand->parent, &pc_low, &pc_high, cu); > Tom> + pc_low = gdbarch_adjust_dwarf2_addr (gdbarch, pc_low + baseaddr); > Tom> + pc_high = gdbarch_adjust_dwarf2_addr (gdbarch, pc_high + baseaddr); > Tom> if (pc_low == ((CORE_ADDR) -1) > > I think this test has to precede the offsetting. Yes, I agree. It appears to me that the test / continue in its entirety... if (pc_low == ((CORE_ADDR) -1) || !(pc_low <= pc && pc < pc_high)) continue; ...will need to be split with the -1 part being performed before the pc_low/pc_high adjustment and the other part being performed after. Kevin