From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2041.outbound.protection.outlook.com [40.107.21.41]) by sourceware.org (Postfix) with ESMTPS id 511B83870C1F for ; Fri, 30 Jun 2023 13:46:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 511B83870C1F 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=vYb9jIFiAPQXRlI8yx8RRVdReDuL6MFfkn9cLTpUkxA=; b=TgEoPymzHFvu+5LjC4KKwiZ/zsKeUQ9Qbv5oTIy884X0B0rucxHXVdABQc8a72k2hwWsCcj6KPqqOYeD1hJY7x2MEC0i0iLTIx4MDUZuO6YyEDPKnL8WypEmR2ggfjV48pbXmWs0SHCVjLCMMyyH8OAk4xm1xZAKlZBhshmestI= Received: from DU2PR04CA0258.eurprd04.prod.outlook.com (2603:10a6:10:28e::23) by DB3PR08MB8793.eurprd08.prod.outlook.com (2603:10a6:10:43b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.19; Fri, 30 Jun 2023 13:46:42 +0000 Received: from DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:28e:cafe::24) by DU2PR04CA0258.outlook.office365.com (2603:10a6:10:28e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:46:42 +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 DBAEUR03FT040.mail.protection.outlook.com (100.127.142.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.13 via Frontend Transport; Fri, 30 Jun 2023 13:46:42 +0000 Received: ("Tessian outbound 7c913606c6e6:v142"); Fri, 30 Jun 2023 13:46:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: e5556b4407779bf4 X-CR-MTA-TID: 64aa7808 Received: from 63cc1495326f.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7ECF019B-990D-41B3-A034-525CFD0B1863.1; Fri, 30 Jun 2023 13:46:35 +0000 Received: from EUR02-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 63cc1495326f.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 30 Jun 2023 13:46:35 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Afgxv7c+SRTcv9pqEGwcjJSzX8Gs5/LKTCj1XJYNItyirFZscHCTOb9VVpxkRe3HrduO9UUC2qgZtoo6+h03h9rpZ4d/v+wfQqyrQhm2d+wmlJNQntwBodCFCDh0x3aLr1pMkErvOUn++W5lIXG9eSaaGP/C/doxoIAK+j9v1x+Bz8xMosHjDoainJzA8MWEWB2fOMuKOI2glo/T/9QkVwbc+HIYbVdAhDOMa5jFv7fjMFo1sLDZdeXapFm2RBZf8Tk0lskOjBsBeKhHWLH8djAmUcjVYonEUMnZ34ts+etYxV0qwXL9MNvW0BeJ5z7CzRW6f1rKMOmGd//u3Gr8wQ== 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=vYb9jIFiAPQXRlI8yx8RRVdReDuL6MFfkn9cLTpUkxA=; b=NmwAgqTR80l3Kh25NqsA0ul10tC6ENIYp+z/WaxfTEPSMEjnO8TYkzYmUdAVPzZWdLcatO/8CHCDPKe0i23wBG6b37PI0/UwRut1ED8vMFH2vtAf/ibxrBxNNj3sO72bWWBOpH1nnUCNe/Vu9ZuZHUx2gXKB4PwnrT+4Dj2ZyH2caK67HA69RTQHLCrS2l3I/5xBnuEZvSSV3BXZ8w0iEuqv+mfHLSPonKwSZAe3tY4lC4VshcIC6h/oUCVVkufkzPfxRLTo/mXEBL1mSRyDxKvRaE7B5mtzvRh1Da5+1GAMKho6xm4t46UpWYgj1SR1LGt2MYMKsmU/MzNltswC3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); 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=vYb9jIFiAPQXRlI8yx8RRVdReDuL6MFfkn9cLTpUkxA=; b=TgEoPymzHFvu+5LjC4KKwiZ/zsKeUQ9Qbv5oTIy884X0B0rucxHXVdABQc8a72k2hwWsCcj6KPqqOYeD1hJY7x2MEC0i0iLTIx4MDUZuO6YyEDPKnL8WypEmR2ggfjV48pbXmWs0SHCVjLCMMyyH8OAk4xm1xZAKlZBhshmestI= Received: from AM6P191CA0078.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8a::19) by AS2PR08MB9271.eurprd08.prod.outlook.com (2603:10a6:20b:59c::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Fri, 30 Jun 2023 13:46:33 +0000 Received: from AM7EUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:8a:cafe::7e) by AM6P191CA0078.outlook.office365.com (2603:10a6:209:8a::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:46:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT053.mail.protection.outlook.com (100.127.140.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6544.22 via Frontend Transport; Fri, 30 Jun 2023 13:46:33 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 13:46:32 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Fri, 30 Jun 2023 13:46:32 +0000 Received: from e129171.arm.com (10.57.27.17) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Fri, 30 Jun 2023 13:46:32 +0000 From: Luis Machado To: Subject: [PATCH v3 06/16] [gdbserver/aarch64] refactor: Adjust expedited registers dynamically Date: Fri, 30 Jun 2023 14:46:06 +0100 Message-ID: <20230630134616.1238105-7-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230630134616.1238105-1-luis.machado@arm.com> References: <20230630134616.1238105-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT053:EE_|AS2PR08MB9271:EE_|DBAEUR03FT040:EE_|DB3PR08MB8793:EE_ X-MS-Office365-Filtering-Correlation-Id: 60d3fa93-31ea-4022-418a-08db7970701d 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: HIv46h5dZcTaUjeqnlwK9t7qqii8KwgAg+y2DFNh4dqHnaDyh6p53DPAM2qxmLrKFPIOvOz8ci8VAI01AmYivKjNZZkUedrjjmR449bxNspW5qTk19DJXOMCJJhWu/yHl6e5BQ/+sWqCffhTs7vOOyTgeGUzCWhrGETOjEYAL3Iim6ImBQvznktrcQmBJQA50wW5AXThft48KqAQdEjfTtBJPGC9kPpKBBKFdtIrHm32YAT4AcqoWyIlhczcfEggGv2vCBEhmR+slEDU0DLPDHsayi8TNcKRRn18tQNC87qUOg7piuabgI2/2/+tn75hnMr41P0wcYmZq98U/R4B3GQGg956Ffbo0Ri6yXrNJGS68AmJBbUauMzLB2q64ejO+d8TzffUvMY8Lb1QueLzik5/Em/kkN7TtKKCempoDf/+We0rFvNECoucd0iU34/2T/vhbab2kFVjusINp+nW83GV1033lbulTdvPFrIDUXshu5DVKn/DOKxAZrLxVoj4tNdirVmJ4KSMO/bWAiyDsQ9BmLyW1cMLlJXuQddtdM6tnW9xYqBOP4jQ6xgJ7iouGWhD8l5JvcccEfG0ClSV/5RaWvcIf/zmqAybqHT9xVHZnWhS6QXqGPhnSNIW+3TnvPpQrI5SvcrlwqMD9HNpUNPAEpvbt8QYdpkxFC78ZYW+WfpxDd6SnNBNDvq/h4gIPGv6IAD4SoIpbyACWQHYi6e3OBhYVsL2+y6VB8q58S9/iiqPbNsmD+J1NAVQLROwblOrk6XdxvlKZzD5Vg8CgQ== X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:nebula.arm.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230028)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199021)(40470700004)(46966006)(36840700001)(44832011)(5660300002)(6916009)(478600001)(70206006)(316002)(36756003)(70586007)(8936002)(8676002)(2906002)(6666004)(26005)(40460700003)(36860700001)(41300700001)(82310400005)(7696005)(186003)(40480700001)(426003)(336012)(47076005)(1076003)(356005)(86362001)(82740400003)(81166007)(83380400001)(2616005)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9271 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 77492cd3-08a5-49ba-a4d6-08db79706a89 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 60BcKBG+UoRBz7NffkvZtbYpZYIg4WHqDK2mnH8MfTc5nhe/goTvJrZwEQkpqoJQFvwo7g6heqOD3/IdQuH3OgylmoPBxWsJKdLke/uhdoQIaflfSPx5mf2MNBKO7qWSIJ4v+wbQRWaT474L2bDx+tMZRYBSz8ZS8pkp7uVFYWMxy1iFs/sd02S9HTfF7laAEXl5lBjQ3xFFW2ZsdE4ZjuNIvRWeORbDMEgNwxmG+GlbOEkAmpMOZY8pLUShnY78SGeTn9RuyK5R8SoNb6BzhVGyFRqusdoCQk6qxHbkGyCGNN3MEEZla2YFAakn1l/UM9YjM3q51jvHkjjellDF4+QRHKpyW0+umlPFvAj3/6fDPgpBQZJVNxB83e0YqBxXtY7AMA3AHDux8vkEYwDxGU8EdbMeoBV3/lQf4HjLvc4cdCbDXqMdpWIEdjJ3i8Twk5SOG1AMQSWD2A3hIq1195LuAfrccEoIWDqGa5SxKzcbqWhQIBHjmdyihNqwDVK3+qSagtXC7qlkGB9v4Ezn311Vmf/HJrw/1+JjtDYIpcXybiHj95Kf5CxStq5Tr6+a+lujF6iaC+SkaY6chsszwCHs378nbE0wilx3qHkri5YwyQRNDbSoYSRmVNmrc/dlPr159sjK9n5BMjNNPKqW0bDdxoL44JuNagoJ2llwuHw3Cv0dku1BgjbEk4lUtoK0OVDwXibxurh/+l4CPXE6saEzpXWVpYKOrLQIfVCxpxn38J9ftq+hUrthLV0Mq+KqBiggFe0LC7E3qBVCf0oBRJ6KMt4PvFU001zV1++A/+M= 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:(13230028)(4636009)(136003)(39860400002)(376002)(396003)(346002)(451199021)(36840700001)(40470700004)(46966006)(82310400005)(82740400003)(81166007)(6666004)(7696005)(426003)(336012)(83380400001)(47076005)(2616005)(186003)(26005)(1076003)(40480700001)(36860700001)(5660300002)(86362001)(40460700003)(8676002)(44832011)(36756003)(2906002)(70206006)(70586007)(8936002)(316002)(6916009)(41300700001)(478600001);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2023 13:46:42.7320 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 60d3fa93-31ea-4022-418a-08db7970701d 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: DBAEUR03FT040.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8793 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE,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: Instead of using static arrays, build the list of expedited registers dynamically using a std::vector. This refactor shouldn't cause any user-visible changes. Regression-tested for aarch64-linux Ubuntu 22.04/20.04. --- gdbserver/linux-aarch64-tdesc.cc | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gdbserver/linux-aarch64-tdesc.cc b/gdbserver/linux-aarch64-tdesc.cc index 633134955e5..3c60e1a4db0 100644 --- a/gdbserver/linux-aarch64-tdesc.cc +++ b/gdbserver/linux-aarch64-tdesc.cc @@ -30,6 +30,8 @@ /* All possible aarch64 target descriptors. */ static std::unordered_map tdesc_aarch64_map; +static std::vector expedited_registers; + /* Create the aarch64 target description. */ const target_desc * @@ -44,15 +46,20 @@ aarch64_linux_read_description (const aarch64_features &features) if (tdesc == NULL) { tdesc = aarch64_create_target_description (features); + expedited_registers.clear (); + + /* Configure the expedited registers. By default we include x29, sp and + pc. */ + expedited_registers.push_back ("x29"); + expedited_registers.push_back ("sp"); + expedited_registers.push_back ("pc"); + + if (features.vq > 0) + expedited_registers.push_back ("vg"); - static const char *expedite_regs_aarch64[] = { "x29", "sp", "pc", NULL }; - static const char *expedite_regs_aarch64_sve[] = { "x29", "sp", "pc", - "vg", NULL }; + expedited_registers.push_back (nullptr); - if (features.vq == 0) - init_target_desc (tdesc, expedite_regs_aarch64); - else - init_target_desc (tdesc, expedite_regs_aarch64_sve); + init_target_desc (tdesc, (const char **) expedited_registers.data ()); tdesc_aarch64_map[features] = tdesc; } -- 2.25.1