From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2060.outbound.protection.outlook.com [40.107.6.60]) by sourceware.org (Postfix) with ESMTPS id 639373858D20 for ; Wed, 13 Sep 2023 13:57:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 639373858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=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=SJQ+28SuFGfvP9Z32XFRoP9jIn691ZbqFAsoVedmf9s=; b=YNI17gzePPIlOvBRkOoRiYwX3feR1C7U7YnmfT2AYLRjEMBNwgN/gOPQw82Rs038aNsBfIvWEsfb4rKdWFEqk/ZsyptsDLOJrFaYRiHFFck80sVeBoNhS5AX2dT9KG2jNn/YcvhiA5qOMFeJCnzDZFuJu98ktnNPisVHtutPZuQ= Received: from AS4PR10CA0022.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:20b:5d8::6) by VE1PR08MB5807.eurprd08.prod.outlook.com (2603:10a6:800:1b2::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.37; Wed, 13 Sep 2023 13:57:28 +0000 Received: from AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:5d8:cafe::ac) by AS4PR10CA0022.outlook.office365.com (2603:10a6:20b:5d8::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.35 via Frontend Transport; Wed, 13 Sep 2023 13:57:28 +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 AM7EUR03FT048.mail.protection.outlook.com (100.127.140.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.19 via Frontend Transport; Wed, 13 Sep 2023 13:57:28 +0000 Received: ("Tessian outbound 169aaa6bf2b7:v175"); Wed, 13 Sep 2023 13:57:28 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 84e68c4216fa932c X-CR-MTA-TID: 64aa7808 Received: from f0f89d3a1f58.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id FB04F150-C7C3-4EF6-8052-27B1210494B8.1; Wed, 13 Sep 2023 13:57:21 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id f0f89d3a1f58.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 13 Sep 2023 13:57:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SWMFUyE9s9+m/Ud6i4Te/DI8h8BbZTSqVGhb6KHusFa+qD+7YQGigtI9hRKpTpbY0H7yskgZAdeFAEuMCIFjqv1lJFUg3Aiif9VmIhtodPn9lxTu3vID3Zf0e0dwJ7O5K2baMB55lhLtI0EMAk7q+T9J0fF4nVZpRxWYOgwkXrU3OfLKAa/ByP28dxa+Qe89tildgDLDf+mwIPDlDh1ZjRC2IGWZ/jkycGnCFk8cfl5RBGb1LywNXPs1irzBqx5Zc7ePKQXC2I4JjxwzB6JZjjpwb8ATVFKBOW3Xdov6OWhssngG9QzpvpXlVLW7h7RLmctjv0rdamjd7o2zEUv0bQ== 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=SJQ+28SuFGfvP9Z32XFRoP9jIn691ZbqFAsoVedmf9s=; b=FEPM7O5F2LaaDV3/OqEvjFxmP4mtPhstqdLzJkj8brlb9ng/UHs0iawKJCOcNQ6LvnBnTXKMw2PGV61/g+k4CsYz+2NjFbxfVKiO4XrvESjNxpQXnScRG+flnRPAsRCJb0e1csFlWIIlOCWdI6zRkP1M0GSjxZNFMTxPL9ORRM5wbHBhjDlOKJ7+MtZMW5j9AAxl97JNZjucRWd83SwjrIPuW9BI9jQ9g0jJzZcgfNjBvToO4d05Op5i+Jy0wDG3JmNSXDL7SUybuCAP5C1Z8gOgQoTxWVBl7S2PYpiF3OM5HAgYSM3yfTQz7VLcZWUPDZeUmZg3/LVKNLWl70NMqw== 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=SJQ+28SuFGfvP9Z32XFRoP9jIn691ZbqFAsoVedmf9s=; b=YNI17gzePPIlOvBRkOoRiYwX3feR1C7U7YnmfT2AYLRjEMBNwgN/gOPQw82Rs038aNsBfIvWEsfb4rKdWFEqk/ZsyptsDLOJrFaYRiHFFck80sVeBoNhS5AX2dT9KG2jNn/YcvhiA5qOMFeJCnzDZFuJu98ktnNPisVHtutPZuQ= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by AS2PR08MB9810.eurprd08.prod.outlook.com (2603:10a6:20b:605::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.30; Wed, 13 Sep 2023 13:57:19 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::7743:60fe:4859:2df2%6]) with mapi id 15.20.6792.019; Wed, 13 Sep 2023 13:57:19 +0000 Message-ID: <0d9a3693-d57f-8560-34d5-ad3db4ade4bb@arm.com> Date: Wed, 13 Sep 2023 14:57:10 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: [PATCH v5 13/16] [gdb/generic] corefile/bug: Fixup (gcore) core file target description reading order Content-Language: en-US To: Simon Marchi , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org References: <20230907152018.1031257-1-luis.machado@arm.com> <20230907152018.1031257-14-luis.machado@arm.com> <5b65717d-0a67-5f4c-e9ae-ff99cc00f369@arm.com> <5d4e32ce-8e52-49ab-927a-cc850528e44a@polymtl.ca> From: Luis Machado In-Reply-To: <5d4e32ce-8e52-49ab-927a-cc850528e44a@polymtl.ca> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DM6PR06CA0055.namprd06.prod.outlook.com (2603:10b6:5:54::32) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS2PR08MB9810:EE_|AM7EUR03FT048:EE_|VE1PR08MB5807:EE_ X-MS-Office365-Filtering-Correlation-Id: d5cae54e-5da4-43a8-0c3b-08dbb4615e12 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: itUtR10ssrFgTafm5sOPT6BKGXKjV9eeCeLFQR3m82OmR5jQKFSdx7ler5XHGfA0Hnd7LltQXfijDaxq9VCZfOlqDccaWcqvS7MVZwpD7Ks/Au1W5z3Xccbwi1ndUKJAb2V77xPUGsQO8gIp17tjQCUFygOM8vVd04kJBxaqCBSRl8NTylmxYI64ytnaHMCxlWlA+iYrGnjno/hrDbB1CNBiBcH7nz184VKzLgykbSEVuT8l3ka5db4opN1savsw50qMViliOZR6deTHZWp4uhYzswIZsdfJr9n885tOf85+fISu47GuLSnQn2/wMDVFbp6D6+MFN72y6OVR9LoNEDWDKqXZcj8tJ2L7TOySQE+ph0k6mYyx9OymADjpci9l5ZN/T5M30uPG5TuDvQsX2a9NNPzUWpJTxZOIwGGnaJEUMVjhDlEf9rH+m8fcvpgPHKOeZRerdJ/Dm2uhS3pwVh+av0UBOSR19a7h3Wr86DvJCllCGgy/Jv8s1WbS0hhnC9urx1dZ49Ei8WdWUgkh3aHo1in0QXhcyvPDl8HX9LioB+/B6Qzo8srK9xtptEQxSNzTtJPc4Yg0R02cyZRRV/vKBg7Mip9bV/lZYq5wPtWexQS6seXXGIITdu2sblNsmcJrrNM5H0I7px5jJLN4TQdmLF9qMJ+CfEcx10ZFJgc= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(136003)(396003)(376002)(366004)(186009)(451199024)(1800799009)(8676002)(316002)(6506007)(5660300002)(2906002)(31686004)(6486002)(66476007)(8936002)(66556008)(41300700001)(478600001)(44832011)(53546011)(6666004)(66946007)(4326008)(6512007)(26005)(2616005)(83380400001)(38100700002)(31696002)(86362001)(36756003)(41533002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9810 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7acc936b-d5fe-42d6-b52b-08dbb46157de X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BI1c0/C7yYLcYCeCuIcSeCjnH186HSqlD/uhytKb6y6cPQtflJfPN3qEijyaqo7qoIo4rkUsEq1lr81ve8TxalhcIp6jW5wg0nEzzPrWjkSs7ZIu3w/1+toNrXtqM0y6p6pW3Ka62eWOv1yrC598XSxrGVfmNnC4nQicHc1IFA0ZrOm1D0e81rbOxZLug2cEckDaBJ5qDgAf94LyyXCpyQvTTPAN7bMLfU3QK/hguVkIsXJfMhXCPnWGAMEPQjTytfRfApsFNjaorKTFPZFnTkboLSbUHyEbVorNxilnN86TCLbb0mlA3/Gccr0zqWbIDcaUIY+6rZO2XYww5VgsJXqoj/6kOUXD5S+rOJ0C6Awl4ek2Eoo8WfjxtucR0BY61b663Kr5wMTJayjhZYJbvLQWunl7Qqb4pO64H2S2ATDWucloJU8a69bJGme4y6Si+znelPUcUiUDMxTMq4r+lu9xmbK4Lfu/1LJtirxaum9ugjaCDWn41tDYXpmUJ9x4nb43T98rI1P/AJxupiw+QYcAXVZ9WFphsV7vtizDoQ/mq13gt4RBAkeA5saNai0RXOegKkuZ99ig9OZlaBkgiBYbc1C5tQ1Ow/9yKeYLzncEkEMziHP1VDkNkNHF8mjhqhqlJqXjuK345K8aXWZO7hymTyykej5FPzNtcvJwdf/xbnW68ih4h57Qx0+YZzacShMbdgbtVAQqwcCCjaHFBFfvdcfJoIQB8WMARd4CC8Wj+JdHZlkK96FYRlQCPf9L6G4iKOivM0hGS3HkGWh8ai5VrGgWfcxxCxzc6DxUGHA= 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)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199024)(82310400011)(186009)(1800799009)(46966006)(40470700004)(36840700001)(86362001)(40480700001)(31696002)(5660300002)(44832011)(8936002)(2906002)(40460700003)(4326008)(8676002)(36756003)(6666004)(53546011)(6486002)(6506007)(356005)(82740400003)(6512007)(26005)(107886003)(2616005)(336012)(81166007)(478600001)(83380400001)(36860700001)(31686004)(316002)(41300700001)(47076005)(70206006)(70586007)(41533002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2023 13:57:28.5656 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d5cae54e-5da4-43a8-0c3b-08dbb4615e12 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: AM7EUR03FT048.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5807 X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham 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 9/13/23 14:50, Simon Marchi wrote: >>> I'm not convinced that this is right. The current role of >>> gdbarch_core_read_description (AFAIU) is to provide a fallback to the >>> note method. Usually, the note method is preferred, because it's >>> precise, but if there's no note, maybe the gdbarch can derive a tdesc >>> from what it sees in the core. Naturally, this use of >>> gdbarch_core_read_description (as a fallback) has to go after trying the >>> note method. >>> >>> Now, you want to to use gdbarch_core_read_description as an override to >>> the note method, which is why you want to call it before trying the note >>> method. I don't think the same gdbarch method can be used for both >>> fallback and override. With your change, with an arch that defines a >>> gdbarch_core_read_description hook, where we would have used the note >>> before, we will now always use the hook. Not what we want. >> >> Yeah, it seems that way unfortunately. Looking back, maybe it would've been better to define the gdb tdesc note as a per-thread entry instead. >> >> I suppose we can still do it from now on, but the previous core files generated by gdb would >> still need to be handled in a special way for AArch64. >> >>> >>> Some options I see: >>> >>> - Add another gdbarch hook, so one is called before trying the note, >>> and one after. >>> - Add another gdbarch hook that allows the arch to modify the target >>> desc read from the note. So the flow would be: >>> core_target::read_description creates a target from the note, then >>> calls the gdbarch hook. The latter could return the same tdesc, or a >>> new tdesc. The AArch64 hook could then create a new tdesc based on >>> the one read from the note, but with the SVE/SME bits tweaked. >> >> I think the first solution would work. But I see it as a temporary measure until we update the core file target description note to be per-thread. >> >> After that, I believe the gdbarch hook wouldn't be too useful. > Well, as you mentioned above, there will still be the case of supporting > old cores that only have one global target description note, right? Yes, that's true. Though I'd expect the most common case of generated core files to be ones generated by a crash as opposed to gdb's gcore command. And the core files generated by the Linux kernel, for instance, wouldn't carry the target description note. But, as I mentioned on IRC, even with the introduction of such a gdbarch hook, we'd still run into other issues that need to be fixed before threaded core files will work correctly for AArch64's SVE and SME. It is something that is broken currently. But those would be best addressed with a different patch set. > > Simon >