From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2069.outbound.protection.outlook.com [40.107.241.69]) by sourceware.org (Postfix) with ESMTPS id 2E2A23858D32 for ; Tue, 5 Sep 2023 08:29:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2E2A23858D32 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=trzMgMeD2rT34IPWyYg0tu0wyHRkznM8scMQVEiXzNw=; b=gJ8n2Xh7Y/IiT/8ASlfE8xsYQ2js9KI6N5E5dOZ1u8DSLu1IWqm9b8I2kmLwcQGJslHE316og19ltQNeWplseFtY+fDmPBu5plCOuvxkOt0sWdgrl9S7eNFiH3pn4HVx2p3NeaAmHppK58MA3VTluCgtlcePq9IsCRC36/qv+UY= Received: from DUZPR01CA0178.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b3::20) by DU0PR08MB9298.eurprd08.prod.outlook.com (2603:10a6:10:41d::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33; Tue, 5 Sep 2023 08:29:09 +0000 Received: from DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b3:cafe::2b) by DUZPR01CA0178.outlook.office365.com (2603:10a6:10:4b3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.33 via Frontend Transport; Tue, 5 Sep 2023 08:29: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 DBAEUR03FT029.mail.protection.outlook.com (100.127.142.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6768.26 via Frontend Transport; Tue, 5 Sep 2023 08:29:08 +0000 Received: ("Tessian outbound 1eb4e931b055:v175"); Tue, 05 Sep 2023 08:29:08 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c5b3979c541df92b X-CR-MTA-TID: 64aa7808 Received: from 1ccefe8314ef.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 13AE4F22-1E51-4CD2-B2C8-ECBFFE177222.1; Tue, 05 Sep 2023 08:29:01 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 1ccefe8314ef.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 05 Sep 2023 08:29:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cq5kE5M3bLKp0XKYMsIVYqMzk+0TvBEOkUjUIoGSTjdSD5miVWmvbghe1a9eAmmMkkJNYMMsz8PbQtH1AP+PO68CpjVtPB1qs/DgJCglNTYXbOkmfeaWdAw/mb+F2vvumbz/rhCwSrJWdNefXBaZlEb99IJYmneTF0O/+jf6x5pLC+w4TdCCcl8ZZ4GQ0qujFgAi7wuDH7hRfecdNycs5J/yEdGesnSZZQd1Y4GMV0a7O29wz8XwSwVx4YLrQAEcJ3Hf05EjcX/T5opxZ10wmil/dzxtKrTJsa/a7lzUC85WBHPbYLKe0PQJaX4WkQlHD2cq6qrfKzvMR8TNAsYBpw== 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=trzMgMeD2rT34IPWyYg0tu0wyHRkznM8scMQVEiXzNw=; b=UhSeHZXUeAq2mdBCEAY6E81mcMOrSd8dwDNDDUXVQE5yzRPRrc+66j5DPxy6BNmqsBhUp8qGvGDlACJS6wK+0/ZoDzcG80UtW1EIlD0CnoYpYU7+Ap8V5lZN8E9zUiTBqHtYMTgr5Zyne9g03zFXqiqgUXQAtXm9SEvp3atAGvsz5TyF9qOUQNQ5MbwHEt/TKjk0RAsGU4cgf5oaqvNUw9ybWewlAl+I7DCUaLGOwDqapQr3/uzkFJ23K177EFoYBr8NNHyjqR1E3vfU9sKqQsriCilCBrx7+VvsSnA3KW4RBjKlxQ2xSHcyiAYBFwCaX0CvqVcEXZZipBtYs/3q3w== 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=trzMgMeD2rT34IPWyYg0tu0wyHRkznM8scMQVEiXzNw=; b=gJ8n2Xh7Y/IiT/8ASlfE8xsYQ2js9KI6N5E5dOZ1u8DSLu1IWqm9b8I2kmLwcQGJslHE316og19ltQNeWplseFtY+fDmPBu5plCOuvxkOt0sWdgrl9S7eNFiH3pn4HVx2p3NeaAmHppK58MA3VTluCgtlcePq9IsCRC36/qv+UY= 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 AS2PR08MB10009.eurprd08.prod.outlook.com (2603:10a6:20b:64b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.32; Tue, 5 Sep 2023 08:28:57 +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.6745.030; Tue, 5 Sep 2023 08:28:56 +0000 Message-ID: <21e33630-a199-c31a-bc55-df26640b8748@arm.com> Date: Tue, 5 Sep 2023 09:28:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v3 13/16] [gdb/generic] corefile/bug: Fixup (gcore) core file target description reading order To: Thiago Jung Bauermann Cc: gdb-patches@sourceware.org, Andrew Burgess References: <20230630134616.1238105-1-luis.machado@arm.com> <20230630134616.1238105-14-luis.machado@arm.com> <878rb07mqm.fsf@linaro.org> Content-Language: en-US From: Luis Machado In-Reply-To: <878rb07mqm.fsf@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0353.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::16) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|AS2PR08MB10009:EE_|DBAEUR03FT029:EE_|DU0PR08MB9298:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cc22dd4-4747-4e6e-8a05-08dbadea2cde 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: xSDUlxH70rL+DlfksWJ3OmgQUKeMbJDZpvjeGU+U0SzgQBiutxefodsOWk5INMikZ15BVXYSbmFlihKFsL//muCR67vrgc1hFFmQjKJxpb86vRcyhGvWwco27QlaTR4wZfkRJkGdJu98k+UMy7MMW7YgrO1H3zed6k5V1d4s0X4SRI87EIJy0O2ykCGsW1VBtr+6uEyEaT91pCj+4vzYI75ApGoV2IJoPNyFmpfSpyHMhntaU+rh7lqh8+dBGd4/Rmb4M/zCq76HyhF+ZQA4Zqv6Xv/qBUrck+cV5Xtrt/V0eYwF6twZ9K0JDpRhT6ZPV7Q5OH8/dmErzjZSh7MOaY7QReKoIfR3fwV/Qbf6rlrSZXc/dTl6gACVMCl6nft9PKyfT8HgdzaAegO9+C9m2hZhfT3G3GRe2XCsLO2AdaudAdcgFdbC78H+vW3e/sDvZf7ik/aQfX7lZwjIESxdbvVwq7bb2yJ5KVPGnOXxKTK9mjrc2AXdn8mOxL+QG8opClWGnEbscjACcFjCPFWe8cZtb/0p8BA5AVirZb93OMnDqVa4Wchz+nrx8BL1i4IS23jK+winHzEYdBS0FswQUQ4dhG9z29UN7ZZQCiDoWtdjKrqKRWVCUeldAPDpIjNJSq3/T3IDkKvDnyhtK2eJAI4pC18uTLfdQrnI3Ucs7+o= 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)(366004)(376002)(136003)(39860400002)(396003)(1800799009)(451199024)(186009)(8936002)(31686004)(44832011)(5660300002)(2906002)(6916009)(36756003)(316002)(66946007)(66556008)(66476007)(8676002)(4326008)(41300700001)(6506007)(53546011)(6486002)(6512007)(26005)(478600001)(6666004)(38100700002)(2616005)(83380400001)(86362001)(31696002)(41533002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB10009 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: DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: d9d25270-0b28-4383-f3d9-08dbadea2413 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5LYHVaNXGbyyhk1/EVnbwBG4A4lqIstQJ7zkzTy57yGNBX4owq6O/gk/zk7JxHCDS/ErW8q9zsLxCGh9GJb1msa+uDRYXApDY3upN9rDXqxp3CV5FgNRbcLbY08FR80qG1XI+tWkvgFCVdab3pCZVORVNXVM2EOrUUMSSYdlm1M2h1tYIZ73ieGV7AYQkIIZifEMVriafa/YFsU6jHJub9R2fr7SrWnXLYtKNL57tc9dvbc8/j2SVmyjtnLL+TFSUYWq8ENYcYvSOu6iQ54AJbWmpnWhSKh9/Myv5wJlyL7KshqXDIoDbSCN/MpbA4MAdJcpo46blVkixRDavNPJiTGdATrjLxySKkT7IZxYvudGoQ9JrLQRsFOhdfF6OQYkb4S9k3X1xHvqU85V0pFrzki0sL8uY2ut2wBtw3/7xab502UdypmO2i/ODzztawPKz2Rictk0UAGYOoI3LS9M8yhwVkg76EO3eAQtBjQPRLv+FIS0wQoXVz6weif07dFQBt00J5vgLN8crFWFEwbyLqdJ+BiUdbTMMm+Nj+TPvu/V1thjYw9ICmM+PoVhaFImKgu+gzovQQzEZ69gW1OgZ0T5WJTUorbETnAzw6gfrhXMq5Ip4RELoEDVXgM/NpU5wVesX11lwCcpIjdQ4Zq2gT70jol4rJmhlqVy8VqUtWaA3TsOj7R5kMnOJ4oBU8fcBPmSVOL7op0D5YRf/cpcF/foFslzvPq5EYoTt1lA/t+iPcvoUQ0N3LfFfHgDxYZzntyb41JnrdxRzut7sughmSrCoUOixZGuXjoxQaEHUN0= 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)(346002)(396003)(39860400002)(136003)(376002)(82310400011)(451199024)(1800799009)(186009)(36840700001)(46966006)(40470700004)(8676002)(316002)(6486002)(107886003)(6862004)(4326008)(2616005)(70586007)(70206006)(8936002)(82740400003)(40480700001)(356005)(81166007)(53546011)(6506007)(6512007)(41300700001)(478600001)(336012)(44832011)(26005)(5660300002)(6666004)(31686004)(2906002)(40460700003)(47076005)(83380400001)(36860700001)(86362001)(31696002)(36756003)(41533002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2023 08:29:08.9635 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4cc22dd4-4747-4e6e-8a05-08dbadea2cde 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: DBAEUR03FT029.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB9298 X-Spam-Status: No, score=-6.5 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: Hi Andrew, On 7/28/23 04:12, Thiago Jung Bauermann wrote: > > Luis Machado via Gdb-patches writes: > >> Due to the nature of the AArch64 SVE/SME extensions in GDB, each thread >> can potentially have distinct target descriptions/gdbarches. >> >> When loading a gcore-generated core file, at the moment GDB gives priority >> to the target description dumped to NT_GDB_TDESC. Though technically correct >> for most target, it doesn't work correctly for AArch64 with SVE or SME >> support. >> >> The correct approach for AArch64/Linux is to rely on the >> gdbarch_core_read_description hook, so it can figure out the proper target >> description for a given thread based on the various available register notes. >> >> I think this should work for other architectures as well. If not, we may >> need to adjust things so all architectures get the information that they >> need for discovering the target description of the core file. > > The code to load the target description from the core file was added in > commit 95ce627aeb9d "gdb: write target description into core file", by > Andrew Burgess. My understanding of that commit message is that it was > added before the gdbarch hook on purpose, and my reading of: > > “My primary motivation for adding this feature is that, in a future > commit, I will be adding support for bare metal core dumps on some > targets. For RISC-V specifically, I want to be able to dump all the > available control status registers. As different targets will present > different sets of register in their target description, including > registers that are possibly not otherwise known to GDB I wanted a way > to capture these registers in the core dump.” > > is that it doesn't work if reading from the target description comes > last, though I'm not sure about that. I copied him in this email to see > if he would like to chime in. > It would be great to have your input on this, as the approaches seem to conflict somewhat. Could you please take a look at this entry (and, if possible, in the other generic pieces too), to make sure we can come up with something that works for all cases? Thanks, Luis