From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2062.outbound.protection.outlook.com [40.107.21.62]) by sourceware.org (Postfix) with ESMTPS id 37EC03858281 for ; Tue, 20 Sep 2022 08:49:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 37EC03858281 ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=SjEPoCSuKZZit9g9mP4w7rNF9JfX3QxBJksFWxbJDY5Mpyp4Oejq08iI8Ny8W7L0YFJjH50WTXUtkdszgBLpD3L0zQqxmlzFCtbA3hT7AqJ0OOIrRgmV/wh06bnIH5FEhmEL8oECkWf5lqLW9XhcQEf20xUdjhMu/Ng60U3oG/pkO8wunE8duIDs3O0VKNq4q8tShUReagMU0ab1qOp7MVE7nxrQqKVNDYDaicHPj8NdTUOg2aoFZyo4AKDFbodU/9LVJE4CLKzF2mGuTE7xhrviA6q55oRH2omOB3gwtpVbpu/Nn1LHPg033UC9z6OCIH8fgQEoR+cpAPppW4RLrA== 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=Puq5Xz7jMvhg/q4+cuD7uvuEpgPKaFnEXl3cz7JCmDU=; b=fzhA3PxL6DuAYUaGY4ySIeUJiyyCm6bA0iGMzUoFVrY8ywIN29HVT4FB0rTqZZDja7ef03ClGKbC7Fi20uzn2tTYgzBAjw+IB4xGZzjo2z6UP+RuCJ9Sxjsw9CikC5waTss4mE4vRqV8T5G8E/Gb3o3xwwpeyDR8EhzeaotRjGw6bBFqcrOtyYycbh82VlkjDwD3ppdKlcjuiCYQFJkuDmNhIIXC+O5j6ouLNFqP8hhahWuh0v82j6VHtoubQc9+cHLRIlcrJtzxcetiw1gWvL6YkapkmmmmrsXuNSVpeF8P967u89fICVlz4TZvnpqCX10TZ7SRjC/iiG3Z8fL6BQ== 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]) Received: from FR0P281CA0126.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:97::6) by VE1PR08MB5758.eurprd08.prod.outlook.com (2603:10a6:800:1a0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Tue, 20 Sep 2022 08:48:58 +0000 Received: from VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com (2603:10a6:d10:97:cafe::cc) by FR0P281CA0126.outlook.office365.com (2603:10a6:d10:97::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.14 via Frontend Transport; Tue, 20 Sep 2022 08:48:58 +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 VE1EUR03FT058.mail.protection.outlook.com (10.152.19.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.12 via Frontend Transport; Tue, 20 Sep 2022 08:48:57 +0000 Received: ("Tessian outbound 3c27ae03f5ec:v124"); Tue, 20 Sep 2022 08:48:57 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 274b19e880c436d1 X-CR-MTA-TID: 64aa7808 Received: from 58811784081a.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EA3EDE72-0A65-4EA7-9A8A-7323C5D0DEC5.1; Tue, 20 Sep 2022 08:48:51 +0000 Received: from EUR02-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 58811784081a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 20 Sep 2022 08:48:51 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=V5qu6bcH1RAJ69o/09yZlWK7EGXWT0JV4xwUmM8TWINaVeJ7u2UWnqIoKOhfAxPd/cYlFIJMblLQhT4Wn2PQcnG7eYUqaKzv8/N/1vxNDWt2kuD3RNp2hr+YSoKVPHRnNk6RPTEQ1S0fXZsna/6qNuPZrjjBXz4QxU1JYizuYVpZp+Epn7LdUqzI+c2kpvoaBAU+ysxoruPNPprJawtVAkJQfiHuCtN2htLHoVzutLlQxU0IHiDyE/9AnTKl1moqSUMz5sSjDrdh5g3hHhNs4i/BaZ5q3mQ6/KGEff/U2D8b3BcKvwfW++j8VnGT4X/tRW2YXH9k4uX1cD1NHIlB9w== 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=Puq5Xz7jMvhg/q4+cuD7uvuEpgPKaFnEXl3cz7JCmDU=; b=GxoQq68i60GAbELLT0hkM1GlnkEa4Ifw/FHKoX7Wqg1EYsrETxDOGwo8g6bwOPJlcwwygQcKKEhLf5gUCNuc82MLhqei25/fAyZovi6WIRgltTsXbUa7kGcfpiPCEq4e5xpY9e+ZFCb2XESsYqUCEZWWuxSZAisBwVx5cpOsWz8NutkokCatIZE3LnX/p7cGc/Lq4GZ1Cl23A0ar9QV72d4DGx1l4UarOWCGi2fbJPdanX+lp1zwLt5XVw4ewQAzjlSIWU2huM3/ft7djlR+zuIctUC8De4niBBxYuqEUFjftIct4QPJxV20UOMwt01KH1MdwenL6tBCpHLOCPXJlg== 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 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 DBAPR08MB5816.eurprd08.prod.outlook.com (2603:10a6:10:1b3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Tue, 20 Sep 2022 08:48:49 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c5f9:a25b:a5f2:6094]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::c5f9:a25b:a5f2:6094%5]) with mapi id 15.20.5632.021; Tue, 20 Sep 2022 08:48:48 +0000 Message-ID: Date: Tue, 20 Sep 2022 09:48:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH 6/8] gdbserver/linux-aarch64: When inferior stops, update its target description Content-Language: en-US To: Thiago Jung Bauermann , gdb-patches@sourceware.org References: <20220908064151.3959930-1-thiago.bauermann@linaro.org> <20220908064151.3959930-7-thiago.bauermann@linaro.org> From: Luis Machado In-Reply-To: <20220908064151.3959930-7-thiago.bauermann@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO3P123CA0008.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:ba::13) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DBAPR08MB5816:EE_|VE1EUR03FT058:EE_|VE1PR08MB5758:EE_ X-MS-Office365-Filtering-Correlation-Id: 97d7dd7a-4eb6-407c-1d34-08da9ae4f4ef 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: 1tS09QAGpT1QL9H5fpKRFvvPJsKAunl5cYPXy3+BwOXS87GsdV8HPN9yCvMi/rfpsQA8+6vjwN1FEMEMm8r7WGye0Y6/ZZO77NSIVbNJzcL4lj4/ZUDauVd7FbCzV8jaaHIGAD4qELR9U5vjmtBVghjLfplom9Pzz0T9J1y7EzeFPco+ZXofn6YlYvSPLCdD5zDNuHNIwy1NDD8llO5KSIaBuoF2KQwfMjFTfyYMpG6LogaL4d2aMD0qMganjUu4RntW14UBK3T8UYaKvVXmuKeMG3vP3858i4/qgrc1qak8HcQQ48r0jyJZKHlP96Jfo32CYHt9m4E7ATOwrp3rKZL1TlamHAKpJO0fJYRbphHuDZXjN0+lVsUnhDioMv9LJa4VN5eW97KTFXoQPbkfBVZ6aD7pkXodLZ7wvoW9jlmyNPlJwUe+u+sg9idGVt/LWP5C9UhPxvtHa0T2rAjFg+YFqKtabDVHZZsOI3jkzPXGnIyinczcxLfhvAYuMlCB3on9ugY8r1YDN2gRe/GkTsxmeVfxzNkD+laxXvui8hcairDC2Vkg7tWeUn+PJJzwls49q2atrfd1g5fkTBkwpso4iHGV+R8yOwJxXOAqYmBqkrre1Mq1p+FPJLPXzpzNmFtJOz/t+fZLjApFqkf2vR2/EYGTFkq/8N0yXIARVmXLneWmSFiRnvS0jHUdtFCfKw+2NI3K+ihDpBXNl8xQdRpJQBH0dtHuytXJ9cLjqGrbvpOonV5dRDbd9SeOmId3vvoxuFBUirm5v6GGmra0X/DhDztkiMNso+a3PIogy38= 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:(13230022)(4636009)(396003)(346002)(136003)(376002)(366004)(39860400002)(451199015)(5660300002)(186003)(2616005)(316002)(44832011)(31686004)(53546011)(6512007)(86362001)(8936002)(38100700002)(26005)(6486002)(6506007)(36756003)(15650500001)(2906002)(31696002)(478600001)(83380400001)(66556008)(8676002)(66476007)(66946007)(6666004)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5816 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 627c86d8-519a-4c2e-31fa-08da9ae4ef59 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V41MJeeFo7lWiTYrqqu41Fzkll91j9kivqCT0/SQM23cIUCNSQMA+Vh+5xz74GKPb0Di1k4wuF9QlXkhWRStA1AxxhF8Wck7tuR27XIXIojZYgKIJEINavhoiMelQniH0BFDRiSEiTuNJKVhTJLAvuz//vxKG3ST7K+jNxZayJnchhfcjqxodV+o2ad4FqW2Xze/nyS4V38l8D64trpctsdMDmKU6ZMMPN88t+g0dDnZTtaw4fmupZnKR3ffpU6qk6jPrmPkkhpogdg2suZSvqQreYN0rJu2SxvJMkpmKAuxuWrwW6DlmotsWVY7PjjzIuatfh3IBuHpwWY20ivPK28V4w2E4KESaMYyBCoZ7XfOh4S2TUo3kRUi66o6yEz4i/caz+WqfltPAJFh4U540UX2ContxHvq46XbOtmoeCvw/mgkoIlIwH7CDo+1M5C55Z9oRwyUe0rPoierva6Gl1J0GTR5nC4Q6nd49hZJVC4pCsQvyp82YaKSfjI5d5XZsJ64Mu9BVS9HC83ZBh+EEGvSPGY/2BdNo5G2zyjBFR0h0eJY0Fl7SHGK0KyCC30GQ7am3NnO4n9Xe+vI/PVPHdPFG4dILHud2iWrbUkOTlGChl/bua1vHiFX4E/yqqAhVSzU6N7sz6udTd2FRf02Vb/uCDDmDjSTL6G5YbCgZuiWlxHBY0I+5WX4lFwYPfQaNZ+1UGbBrvg0wMRt3CvkbWfKGraamZOER1hX5phHtBtbrCikHDqhWWibzYeJSmVQr19COc8ZeL/SWBSnk4n56lnWPNxg4B9/BsSjzAghywTz5Lv289Fns9eaJOrGPDpg 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:(13230022)(4636009)(396003)(376002)(39860400002)(136003)(346002)(451199015)(40470700004)(46966006)(36840700001)(31686004)(15650500001)(44832011)(36756003)(2906002)(82310400005)(40480700001)(316002)(36860700001)(82740400003)(47076005)(8676002)(5660300002)(70586007)(70206006)(31696002)(8936002)(86362001)(81166007)(336012)(186003)(478600001)(2616005)(26005)(6512007)(356005)(6666004)(40460700003)(83380400001)(6506007)(6486002)(41300700001)(53546011)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Sep 2022 08:48:57.7787 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 97d7dd7a-4eb6-407c-1d34-08da9ae4f4ef 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: VE1EUR03FT058.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR08MB5758 X-Spam-Status: No, score=-13.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Sep 2022 08:49:05 -0000 On 9/8/22 07:41, Thiago Jung Bauermann via Gdb-patches wrote: > Introduce new arch_update_tdesc method to the linux_process_target class. > > This allows aarch64-linux to probe the inferior's vq register and provide > an updated target description reflecting the new vector length. > --- > gdbserver/linux-aarch64-low.cc | 21 +++++++++++++++++++++ > gdbserver/linux-low.cc | 18 ++++++++++++++++++ > gdbserver/linux-low.h | 5 +++++ > 3 files changed, 44 insertions(+) > > diff --git a/gdbserver/linux-aarch64-low.cc b/gdbserver/linux-aarch64-low.cc > index 8c4306ab8794..cc90eae1e36b 100644 > --- a/gdbserver/linux-aarch64-low.cc > +++ b/gdbserver/linux-aarch64-low.cc > @@ -99,6 +99,9 @@ protected: > > void low_arch_setup () override; > > + gdb::optional > + arch_update_tdesc (const thread_info *thread) override; > + > bool low_cannot_fetch_register (int regno) override; > > bool low_cannot_store_register (int regno) override; > @@ -902,6 +905,24 @@ aarch64_target::low_arch_setup () > aarch64_linux_get_debug_reg_capacity (lwpid_of (current_thread)); > } > > +/* Implementation of linux target ops method "arch_update_tdesc". */ > + > +gdb::optional > +aarch64_target::arch_update_tdesc (const thread_info *thread) > +{ > + gdb::optional features > + = aarch64_get_arch_features (thread); > + > + if (!features.has_value()) > + return {}; > + > + /* Adjust the register sets we should use for this particular set of > + features. */ > + aarch64_adjust_register_sets(*features); > + > + return aarch64_linux_read_description (*features); > +} > + > /* Implementation of linux target ops method "get_regs_info". */ > > const regs_info * > diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc > index d37eb120e114..2a7c6f166a65 100644 > --- a/gdbserver/linux-low.cc > +++ b/gdbserver/linux-low.cc > @@ -483,6 +483,12 @@ linux_process_target::arch_setup_thread (thread_info *thread) > low_arch_setup (); > } > > +gdb::optional > +linux_process_target::arch_update_tdesc (const thread_info *thread) > +{ > + return {}; > +} > + > int > linux_process_target::handle_extended_wait (lwp_info **orig_event_lwp, > int wstat) > @@ -2354,6 +2360,18 @@ linux_process_target::filter_event (int lwpid, int wstat) > return; > } > } > + else > + { > + /* Give the arch code an opportunity to update the target > + description. */ > + gdb::optional new_tdesc > + = arch_update_tdesc (thread); > + if (new_tdesc.has_value () && *new_tdesc != thread->tdesc) > + { > + regcache_release (); > + thread->tdesc = *new_tdesc; > + } > + } > } > > if (WIFSTOPPED (wstat) && child->must_set_ptrace_flags) > diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h > index bd1ec31dc5a4..fba462744953 100644 > --- a/gdbserver/linux-low.h > +++ b/gdbserver/linux-low.h > @@ -602,6 +602,11 @@ class linux_process_target : public process_stratum_target > /* Architecture-specific setup for the current thread. */ > virtual void low_arch_setup () = 0; > > + /* Allows arch-specific code to update the target description when the > + inferior stops. */ > + virtual gdb::optional > + arch_update_tdesc (const thread_info *thread); > + > /* Return false if we can fetch/store the register, true if we cannot > fetch/store the register. */ > virtual bool low_cannot_fetch_register (int regno) = 0; LGTM for the aarch64 parts. Someone else must approve the generic changes.