From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2082.outbound.protection.outlook.com [40.107.6.82]) by sourceware.org (Postfix) with ESMTPS id 2F0283858D37 for ; Tue, 19 Mar 2024 10:49:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2F0283858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2F0283858D37 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=40.107.6.82 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710845357; cv=pass; b=P5HnkNqGlC3kFPGIdfTXNd8+ssNvF83Nh+Z+qCZxAlUA/1v8o5tEywBakz3LFPAuM2k1CbHkm8pBESqk8WR0nXRpeRtJp9tKjifl2EnAIyi3Zc02fvwSaYA7Tfyu0hgg9stPJZJ2K2TCZpi1BLPzlgB3gVVNSILQg28+dRWvYZg= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1710845357; c=relaxed/simple; bh=teKefUsX++1meJQYIXb6aURty1EUFVfDIvcxFzuQ0kM=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=JqztPGG3GfefiQwgHOhHV0Cm8EOpyysg/7KKg04r9AXHCGxydDq411VTWokX4hx48Tu3DwqHgkDOiShbanu1WkFhtm+kxwLVQdRnhRMRSapozyW/PyULcLKDX7wohrOhcTBhdt3o+ZfgDyZjoF+uRb63qDMTRO8CRWVtdbkxluM= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=PkxDb2nECuWX1bSYIPBivn+laoR2qf+iDfzMhMFqzuyERceigtYxNjhlly90eELoh016tLp28zWAfwE4Sciv8M4VjvargId9kybtaFICbz7+VsyuCdzrD7LavvPSWSU54j4SmJLb0uGdMbbwQj9elTw9ngoVMct5NfyKc3cnsrl08H9OCFjciKA4Y3tUPtM8Ayw+W1qQr0wcEot/fZOFek3YCsNBl/m5cYxjnqZMFFnzZa8PDw2sH3hapj05nJA5Mxs5OM5PeTC8zdmhg+GchuWSgEQnHgvfw37ivXhSh5ttzQuiKaQZjMRqPCUWI2FicdFcHym2go5Ly63JSQe98g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YcDr+umgFWoqiCWNSYSuWqVW4PDjWpi+Xk3d2DCe7ps=; b=I6qRnzH7gTlQff+jQy4Smf6T5L6x8PirR4NhhnL4HOzSWsVEOwnL3JLxtFEVDN8Q2/xPhWo64Sima3criKWwZB9lszJFUlbUxucTpzWd92hs2Vi3/p0LHzMCLR8PHiHSKIknEbtT0SRT/TSQ3celA1bNTvxBWnjWHSIuDNE25de11xT4vziHaDCq5FQPe0flOwGef6YPwpkNWMi45DvCvE6bCOERMJ3yJZmgzQy/ssLCnNlPc4gyjUEHz1Tteex17Yxd/KbLk0JCRuWN2gfrTehluW8ORESzl2iBQCzd6p0QoM+YfG662DpMBotoHm+1LDJhAF6lmNmWYOzH8dKjng== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YcDr+umgFWoqiCWNSYSuWqVW4PDjWpi+Xk3d2DCe7ps=; b=6W+kX97t8/LY9u7sQvX6OUfxBtXUv+qq7Mg4h4ApVqVPoA4e3FnH2caNhpe3LXGo9qNyGmTHYtdZafPttVZoVd7N0/rwzqqPlInJqTgGlmg4S+GeON59Vxjo40QuLvbyCJNR5AGySUkOT8fcFJXDg4bPyKFUuwYrrgljQsfBPEk= Received: from DU7P191CA0030.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:54e::15) by VI1PR08MB10145.eurprd08.prod.outlook.com (2603:10a6:800:1ca::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Tue, 19 Mar 2024 10:49:10 +0000 Received: from DU6PEPF0000A7E4.eurprd02.prod.outlook.com (2603:10a6:10:54e:cafe::2a) by DU7P191CA0030.outlook.office365.com (2603:10a6:10:54e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26 via Frontend Transport; Tue, 19 Mar 2024 10:49:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU6PEPF0000A7E4.mail.protection.outlook.com (10.167.8.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.10 via Frontend Transport; Tue, 19 Mar 2024 10:49:08 +0000 Received: ("Tessian outbound dc0a9029eb2c:v300"); Tue, 19 Mar 2024 10:49:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 24e3021ce146b33c X-CR-MTA-TID: 64aa7808 Received: from 2d5198612516.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id B7AE2AD0-1370-430C-B10E-1FB3380F4F59.1; Tue, 19 Mar 2024 10:48:59 +0000 Received: from EUR03-AM7-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2d5198612516.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 19 Mar 2024 10:48:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DgPbJQh9cn9QiT2x9T3sM5ftKxcRutJk39j1dhyHt3nJ3yTZpB9A2w4LCpQU8jm0G6cIotlnt7K/yuijZyNvsUVzgwACO4TaH9G2GXGfe95bXOez7YkaLQKU3qVnZkDsUeWA0pNtyXRbBW8hc8AdDATOrWAprNEtUJdiU+GHBBbhq9aarHeL5NJbIzT4erNGutCwA8Up5akb9k8V/2+KF4e4dlmwrI/IoU0huBrekV1mBuj0vr/LkzyXb3EpIXW+7RTVpeTpsID/BAyW7uyFN/6gVK8ipQHKOvWS/nJYr8/zZN7/agtgLQeBL0mYcslEmFhODJgOxSXWl0pab/G9nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YcDr+umgFWoqiCWNSYSuWqVW4PDjWpi+Xk3d2DCe7ps=; b=RlJFow6AV/Z7rOr8NgDkMH9JlCCdW8dhyPIn0yoRnwj6WH4Gz7jLyrQz+MzOjpaTmag6C5EAuD/LgQM54g8YKEk+SQ7mO2EXSrUzLesbyXQzT9d5jeRZ5KLDHhKmqg63d+sne52bATaeg1HmPKS5aHKv0HgVBmroWDa01iSpcE/cOvkYJ67GNfjaVV5QRc7lhRC18QWq0BpxmbUEdj7lSdtz2nUxGYRzclhxcbfSpJV4c3PBnetoBLirm3rWecpQTN0L6h3CWM9uKYMd+E9pmxxlKso5jV6O14H8K+j509o0Q1LGk+HneoiD2ysb3dRirUR9UF7FsV7+ryqTESu+xw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YcDr+umgFWoqiCWNSYSuWqVW4PDjWpi+Xk3d2DCe7ps=; b=6W+kX97t8/LY9u7sQvX6OUfxBtXUv+qq7Mg4h4ApVqVPoA4e3FnH2caNhpe3LXGo9qNyGmTHYtdZafPttVZoVd7N0/rwzqqPlInJqTgGlmg4S+GeON59Vxjo40QuLvbyCJNR5AGySUkOT8fcFJXDg4bPyKFUuwYrrgljQsfBPEk= Received: from AM6PR08MB3911.eurprd08.prod.outlook.com (2603:10a6:20b:80::27) by GV2PR08MB7930.eurprd08.prod.outlook.com (2603:10a6:150:ab::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7386.26; Tue, 19 Mar 2024 10:48:57 +0000 Received: from AM6PR08MB3911.eurprd08.prod.outlook.com ([fe80::b5b8:f2e4:37bd:4726]) by AM6PR08MB3911.eurprd08.prod.outlook.com ([fe80::b5b8:f2e4:37bd:4726%7]) with mapi id 15.20.7386.025; Tue, 19 Mar 2024 10:48:56 +0000 Message-ID: Date: Tue, 19 Mar 2024 10:48:55 +0000 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/symtab] Workaround PR gas/31115 To: Tom de Vries , Tom Tromey Cc: gdb-patches@sourceware.org, Thiago Jung Bauermann References: <20240306155315.22240-1-tdevries@suse.de> <87r0glsvwz.fsf@tromey.com> <3c788bd8-df7d-418b-8042-167e3c3ae5d7@suse.de> <912349ca-7daf-4a6b-88d9-a2908227e32f@suse.de> Content-Language: en-US From: Luis Machado In-Reply-To: <912349ca-7daf-4a6b-88d9-a2908227e32f@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LNXP265CA0062.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:5d::26) To AM6PR08MB3911.eurprd08.prod.outlook.com (2603:10a6:20b:80::27) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: AM6PR08MB3911:EE_|GV2PR08MB7930:EE_|DU6PEPF0000A7E4:EE_|VI1PR08MB10145:EE_ x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: /NK6NxzozARggscYZ+FSLKa+XOLaM4GEbnddjxCXNmY4DeGz5G10JZCjiHVGnNkYx3snF4HOENXM6K+DSIFcmSqJ1v83Wl4tBKSa1A5LZ1CyWPj+ktQRKNPyfJ/dKB4TDtC526htGaHVk9y7WA0+LKO4VoEhddkdFcNu4KVMVqSlk9DZxZMfQb99jyy9f9vw37V1Sr/pKI8yCHwfHq3djaEvf8haXs6erZKsuHG3zhdzcwwYXltrvrtmHhuC8aY8qTue0VuIrB3ttY0K8/i9zaU4XOUKrHexEOldcg77asw7MzmJ9HiZHdXMybLWnDnXt+IlMzezpgQYGws+9WwTMKxccSjvP3wd7fcXWo/S3yfw+4H1AlITTSMUXwZ8QYhpLmBzDNsngA2MIAdj+wjikvcZxeu/eOOobs6qDBhAt2cBnMEOCh4j8dpv5Z3DG6xWKggi4UfTz0O+mO4oUyZj+jsKam5PMCIGtMKGyp5l1q2PglLn+rmIMXxQr4MTejkDTKTsshQ3b/whLL3JMaaY+g5gUUNOVlc1FJe9owKxqAR7X7T3c9sOD/M2AstCZfAvx8OU9ctQ7EZVB5dNrzzXMSeIKYnynwPtanP15RQNZWMxWWduErujoBA8SZ5DyfIz8PPfxgmY1O+RY/oaV2fMmDwOgcqEZ/8VB+DUl3/UK2g= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR08MB3911.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(1800799015)(366007)(376005);DIR:OUT;SFP:1102; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB7930 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000A7E4.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b1ca4ebb-542a-44e2-acf1-08dc48023485 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: izEbgX6EF0h3nW9lVy7TcF+XXqyOHAOkHPQJfdxpZYBESJCaxufGlNPRGf9hOlBo+lkYrJ52dQMKqSrpBg3fevafdIVgrPxKezdl7vsfIj5dJa3N/9ZYWTq4oOpZeUqeAfiHtwhrXcVbmuBmigG6RIbhSjWrWMgt9hL5WqLDlriwv0e1Sv/BqXDegSZi+uXN9cPU3/Ab7h5ONJi6sokUEeakXwbic5qzFCZ45QLtqfRKSSMdPMZMOmbvBg2ZsSgABS5jgIldMuYp+JV/9ykJ2aZobFbgwxMiP6tuLP5NtDmJJdoXRH59N9YsRF6X0JgoSqgKfcHc9dJPPq4ePWSuB983xAbDbTrIwLQo1vVPlGpYIDkg5/aN2tzGaLwi/ae/F2oc7BR9mXaY7ntR5Ypisyy8bHugraTp1YP8RQX9M5Jxx4Uf+YRY1QntC/vU0HQQsFfy6UFxJLmjUbQbm/Ovrph+tWawRndhvYM0fM77/BYKW+vrdoE1kFFcTESy/cW0OAUXY2Jxb/yeVaUxVFqPpIwYm/hk7qQ3m13++YeO/jMMNmUTBPmuBl/HE+TTMH6p+3Woeq1JYhxqV4I0XEZSEDkv4tsf2Haqt4ogeVJdRbjOhanuVneYndTk/s38UxCBhizrOi46+vpUsOlONUkqguWo6JrhMswa9s/Z7AaBh7iqCoXWFyghFQloeLsYrIvu46pgrs7d+YALXgBZrRyU1vTojujsL8cOSVcU4ckuY8Cmfwea+1vpdjwgmjsTM+01 X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230031)(376005)(82310400014)(36860700004)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Mar 2024 10:49:08.8078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1ca4ebb-542a-44e2-acf1-08dc48023485 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000A7E4.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10145 X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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: On 3/19/24 09:39, Tom de Vries wrote: > On 3/7/24 22:09, Tom de Vries wrote: >> On 3/7/24 20:07, Tom Tromey wrote: >>>>>>>> "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? >>> >> >> I don't know.  The only information I have is that it never should be the case for arm, which is info I got out of the PR. >> >> The target hook is present for other archs though (hppa, mips, rl78, s390, sparc64), and I don't know what the requirements for those are. >> >> Which is why I limited the scope of the fix to the arm architecture. >> >> I also limited the scope of the fix to the known wrong producer, that might not be necessary, it's just defensive programming. >> >>> 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. >>> >> >> The only arch implementing that is mips, and looking at the implementation, it filters out the ISA bit (bit 0) and then sets back it if appropriate. >> >> Which is not the thing we want to be doing here for arm. >> >>> 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. >> >> As for adjust_dwarf2_line, well, the mips implementation (its only implementor) is a thin wrapper around adjust_dwarf2_addr that is stateful.  To me this looks like a candidate for removal. >> > > I'm planning to commit this tomorrow, any objects? None from me.