From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id BBBEE3858C36 for ; Thu, 7 Mar 2024 19:07:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBBEE3858C36 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BBBEE3858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709838451; cv=none; b=stJRIAhRLMUNHkmC+GwzPtLZo0Bqk/KbfjHdttB4v5xvxEIdgLrrI5kgfDea4nrpff2Y2vXXmBOedT1wsdZkO4zq6HOhHs9P9glVE7veEDCdTAQNmc9SXlfkDMLQmpyOB9Wwa8E49HfPUgdm5s94+G5vd81WVLPxzF0MWkEoN+Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709838451; c=relaxed/simple; bh=ABZIdh+SdB+04ie1KG0kS0iWvik1YnfwTnPEV4SdbIg=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EbBL3vw9gKSRFKnDCYnhot+uiDyehjXDda0lJv0s5NHe8SwyabCNgE4B3TcGEg8ujtZUe7GWRjIcffl8SSJAPBJZzTYy3MIUrLfO20ebdKi/2WF5KA6IdXqhob1XiWgS9zqw3t6UHOJis4rxHVYNeiECFOgosmQo34CRqOnMGtI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-6007a.ext.cloudfilter.net ([10.0.30.247]) by cmsmtp with ESMTPS id iGM6rkfL6DI6fiJ5TrugDK; Thu, 07 Mar 2024 19:07:27 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id iJ5Sru4tENOOTiJ5TrOkNw; Thu, 07 Mar 2024 19:07:27 +0000 X-Authority-Analysis: v=2.4 cv=EabOQumC c=1 sm=1 tr=0 ts=65ea106f a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=K6JAEmCyrfEA:10 a=Qbun_eYptAEA:10 a=3CajmPJpuNlst5spyEgA:9 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=AauLMk4UNvTjTE0aEI5NqfZ3n9wgBme7y1ZGWBewWlE=; b=oLmM+7iE28pti9YvHyQRvzhKNR qxwGLgByz1+63Rj3Q3lBfwivGo5FAz14suqdg1TvuwPz3xm4QEtC0kGDyFpxH4yDa5rQ6v0hCaMzC V5QDUztytsRVPj5xqv3h/G4oc; Received: from 71-211-170-195.hlrn.qwest.net ([71.211.170.195]:51724 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1riJ5R-000gfK-1d; Thu, 07 Mar 2024 12:07:25 -0700 From: Tom Tromey To: Tom de Vries Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/symtab] Workaround PR gas/31115 References: <20240306155315.22240-1-tdevries@suse.de> X-Attribution: Tom Date: Thu, 07 Mar 2024 12:07:24 -0700 In-Reply-To: <20240306155315.22240-1-tdevries@suse.de> (Tom de Vries's message of "Wed, 6 Mar 2024 16:53:15 +0100") Message-ID: <87r0glsvwz.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 71.211.170.195 X-Source-L: No X-Exim-ID: 1riJ5R-000gfK-1d X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 71-211-170-195.hlrn.qwest.net (murgatroyd) [71.211.170.195]:51724 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfNtXpCXN2B2NIJYmM6LELaK7y56pSazs+jg9MYBjgro8BBDfb4dJk82bQrQHZmm29/PTP1Gk8jpfY9Lt958ONB1YFAqhy0hWkAK9m9kmrQwnb0ApEZHC l4KwAQxLYYyY+z2ML67XBHjk+AqZxsBLHzGpqRJJK0DXuBiDFx4JJcPcWgozDGd2dN8r8XCO9hGqh0ZX0Z4uk5rER7nUdeimcOk= X-Spam-Status: No, score=-3015.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,JMQ_SPF_NEUTRAL,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: >>>>> "Tom" == Tom de Vries writes: Tom> This is a regression due to PR gas/31115, which makes gas produce a low_pc Tom> with the thumb bit set (0x4d8 & 0x1): Tom> ... Tom> <1><24>: Abbrev Number: 2 (DW_TAG_subprogram) Tom> <25> DW_AT_name : main Tom> <29> DW_AT_external : 1 Tom> <29> DW_AT_type : <0x2f> Tom> <2a> DW_AT_low_pc : 0x4d9 Tom> <2e> DW_AT_high_pc : 12 Tom> ... Tom> The regression was introduced in 2.39, and is also present in 2.40 and 2.41, Tom> and hasn't been fixed yet. Tom> Work around this in read_func_scope, by using gdbarch_addr_bits_remove on Tom> low_pc and high_pc. Are there ever cases where this bit ought to be set here? Tom> lowpc = per_objfile->relocate (unrel_low); Tom> highpc = per_objfile->relocate (unrel_high); Tom> + if (gdbarch_bfd_arch_info (gdbarch)->arch == bfd_arch_arm Tom> + && producer_is_gas_ge_2_39 (cu)) Tom> + { Tom> + /* Gas version 2.39 produces DWARF for a Thumb subprogram with a low_pc Tom> + attribute with the thumb bit set (PR gas/31115). Work around this. */ Tom> + lowpc = gdbarch_addr_bits_remove (gdbarch, lowpc); Tom> + highpc = gdbarch_addr_bits_remove (gdbarch, highpc); 'relocate' calls gdbarch_adjust_dwarf2_addr. I wonder if that's a better approach. Right now there are a few gdbarch methods here and it's never been clear to me why they are different or when one should be used or not. That is, there's also adjust_dwarf2_line, which is used in several other spots -- except dwarf_record_line_1 which for some reason calls gdbarch_addr_bits_remove. Tom