From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2084.outbound.protection.outlook.com [40.107.247.84]) by sourceware.org (Postfix) with ESMTPS id A2F4A3858C41 for ; Fri, 19 May 2023 10:25:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A2F4A3858C41 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=QxkAnhp3myujNgDscYiqUQKLXsta1vofnf3q89/pnjLJ23TJOKZt5h71k7dDPwkcMtWvDSsWxmozvTNJfN7ENdGN/P4PSSyU6LBu+vByekVObRoulusz6CrZxURhjcQPBk7Q0u3v3WKxY1WrsNz0iRwJuM4a3t/S1f6By/X5SnE= Received: from DUZPR01CA0002.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::8) by AS2PR08MB9896.eurprd08.prod.outlook.com (2603:10a6:20b:5fe::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.18; Fri, 19 May 2023 10:25:21 +0000 Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:3c3:cafe::32) by DUZPR01CA0002.outlook.office365.com (2603:10a6:10:3c3::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19 via Frontend Transport; Fri, 19 May 2023 10:25:21 +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 DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 10:25:21 +0000 Received: ("Tessian outbound 5154e9d36775:v136"); Fri, 19 May 2023 10:25:21 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: b1537e8f72683189 X-CR-MTA-TID: 64aa7808 Received: from 5513df769913.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 152C4B81-3F7D-4614-B707-F4876990CDAE.1; Fri, 19 May 2023 10:25:14 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5513df769913.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 19 May 2023 10:25:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BJgeq6POnwAEJ9HjU6Jy4WbEy6Wcu6iJNMWeCftNkBbjpe/KInlkrtVQocR9J4j73jX5rA+7KVkAGq+IQKHBnXisckGHBTKrjfRkLASkPdupv+RQ4m7XGHIAo/5pgT8BgM8YWlDjNQELJXYYBDLRxdXeWCTJtSdC2Ntc0hqO8N18wHW8I3Vd4a7DeF5n7B8teZpR49xwwHLsq3UTRhjmPBAPryli+eoIZTzy6oTm++N24yI4MMDPnC6/bAe7ddYpIzBYn66WNABcBtJy7EM6cTBCR/husVsjtV9YIwHcmz+s3HnIX3c+1wAgYHiKNQEVcH61N9VJZM1jeHBjIgV4Uw== 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=UdQIdpw/zrvgu/aBB8DtUyAmLONO01+AM0wRIGHJEdGm0qX2XDDTZvFa1p6N8xbmjeuPX4/GxAltGwR2ELzYeFREKsNQLbAAQGOl/CFBGnkQhJXv6t4DYoMhiLnCGDJsnX12QA3hP8DY8dpjRKK/0Ds+dj/5czto3yKIDNxUwku4Ni2tkGhMbLXUs64AZwBn0b+1R0COajzgZ89ioF4KtS33TZiggEpixxje8bnac3xUQEez1F4WpLRLNDP34TqP2IqyQY+KnHcFmrKBc1pWOheAAwiqTktnNCLNG0icUjDqp9yIGAhs9nhPHlm0bmNOAy92iONBqCARvJ3wbgWwHA== 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=QxkAnhp3myujNgDscYiqUQKLXsta1vofnf3q89/pnjLJ23TJOKZt5h71k7dDPwkcMtWvDSsWxmozvTNJfN7ENdGN/P4PSSyU6LBu+vByekVObRoulusz6CrZxURhjcQPBk7Q0u3v3WKxY1WrsNz0iRwJuM4a3t/S1f6By/X5SnE= Received: from AS9PR05CA0186.eurprd05.prod.outlook.com (2603:10a6:20b:495::35) by AM9PR08MB5988.eurprd08.prod.outlook.com (2603:10a6:20b:283::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.19; Fri, 19 May 2023 10:25:12 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:495:cafe::a8) by AS9PR05CA0186.outlook.office365.com (2603:10a6:20b:495::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21 via Frontend Transport; Fri, 19 May 2023 10:25:12 +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 AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6433.7 via Frontend Transport; Fri, 19 May 2023 10:25:12 +0000 Received: from AZ-NEU-EX03.Arm.com (10.251.24.31) by AZ-NEU-EX03.Arm.com (10.251.24.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.23; Fri, 19 May 2023 10:25:12 +0000 Received: from e129171.cambridge.arm.com (10.1.37.65) by mail.arm.com (10.251.24.31) with Microsoft SMTP Server id 15.1.2507.23 via Frontend Transport; Fri, 19 May 2023 10:25:12 +0000 From: Luis Machado To: Subject: [PATCH v2 06/17] [gdbserver/aarch64] refactor: Adjust expedited registers dynamically Date: Fri, 19 May 2023 11:24:57 +0100 Message-ID: <20230519102508.14020-7-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230519102508.14020-1-luis.machado@arm.com> References: <20230519102508.14020-1-luis.machado@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT009:EE_|AM9PR08MB5988:EE_|DBAEUR03FT044:EE_|AS2PR08MB9896:EE_ X-MS-Office365-Filtering-Correlation-Id: 9c6a320f-fc38-48bf-999f-08db58535997 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: F+pU7XdMeSQUBewRkFpnJddV1BM+CiTaErixtk5eQ8dMgAAGpuLKRp10edWL1Mpyn70fhVieD7VK8lJCJHMU0MqThkA53NzCcJVh4Y8SCxtvOldhAfHEGv1sU7keyfBLzOtUC1zF3IE4L9vbMk/Fa89tn/RgNXTvkHKwd92v7hg2hw6uQKr07mpEgiC8sA1wlGoV3xpL6DaOJ1wFdZFZSPlUoyeYLPrdEDOmY4ylZsJ13sDUfdhqa0tXZIz58WAaZ3dXNKTo9Sxwot2CoaS3Us2LZTgUQuZq/FacEmANjrNzkFD9pFdvsCwE7HLHTS1ORcJq94veYGk2GZ5R/RyMxx8MMTCZEOR3Sw3zmGmSk6FgrWd05JwGPera3itB5AAGqeE8TMvQRelCkLKC5NQhx3NLf7RJFH87+RrIRwrTGcgPlvvvUUZrKgEm5PBET6ZcD0t3X+pLWKIsz9C48DAbgqsxurrfMy6J2mDYXbflH24Soy8rNeCqQGpHtJR4g+c8mu86AzyJ4Rdu/Mggl6140zTniI/Ymm/ocTb67u91DrLYLbo7QnGt+PBq63fYlU+C7DLWHZM8Snkol9LIcufyg1wSPUlQCEGIjwf5x+PudwZDJ2hkUmWmv3Ao7A4kx2cdkijqZzbFh0f+UcuymSa9/rD4huyXVFThfAf2xGhZDEoHyCatbCCfl3prF6khtOgiOp10T4EV3G4WyF7tsneh7Um8wuT879Tf7YI8yEWnHuhU70J9YhEQZ811kq3OLTnpIdJdOUN4MVWtMSdTv/MNIQ== 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)(376002)(346002)(396003)(136003)(451199021)(40470700004)(46966006)(36840700001)(86362001)(36756003)(6916009)(70586007)(316002)(478600001)(70206006)(44832011)(82310400005)(8676002)(7696005)(40480700001)(5660300002)(8936002)(6666004)(2906002)(81166007)(41300700001)(356005)(82740400003)(2616005)(426003)(1076003)(36860700001)(336012)(26005)(83380400001)(47076005)(186003)(40460700003)(36900700001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR08MB5988 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: c30499f5-89c6-4e21-0002-08db585354a6 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AQtCoX1ArWDlmmrhiqk4M2zaCF62nBQWBLFyHlYE1iL4a53GS0CAkTodDSAC0vByrPJtKk3ibx3J4qmxE0rVHihPsPPjrTPPDuiVHxbTabjyjNijGEFPn7vO/ZdkAw04y5SLs6ppvC4mhZY5ejvRToZgBlB12S3jYxHachLecvkMBZv+qzk8pDW/wzDe2qL/hOT0LAYHJ6sWhhT0QVFnzFs5G42LcOyL5t2PWN+YWaEGitoC4SHeQ41hXmzH3Zblm76D74MdkdrqSO2orb2KnFF8m7+a9J9EQzcJ6MmLqThBbTTvM+vu0XqJv51WyVysnsMaxZcgMybJgoYPPa1QSHqHTh6GJd0Q0EWz73MiqPn0Yi0bfT+G+UyyeoYMVNgDHHNwl4gwArRhU1qdqzBaCamoC+cj+Z4l+fGiOXQ+yrFovuWhsbEi3X4V/AMeCjhRIj9Ri29G5OYpHut92GSdNkiTFSn/U/DVUpIH/n7eWltSeUg/cZFSL2eCm/qzkhNVNUVXk63r9cTdwb/o61/+bdoSzmd4xDMQ3NsgMnDtBqxbjUnFOsrzn7vhslqoqLn690b6InXmDUfknHY84rE9C9QaV2EUjgojYHj07QHXYgcKtHHQbLw9/eAKivtkkOhI28PWsBFUl33uprT+VbsWDeK3ertN6CK3pa+d6VPAau/aQXQXS0uFJSTueiDtS2fS1WUGPxLAppI+NYWoe4oGI2TQI7w6QhjPNNXmDSwftc+h2NIglLrFDAviDnykL8+4 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)(396003)(376002)(346002)(136003)(39860400002)(451199021)(36840700001)(40470700004)(46966006)(86362001)(36756003)(70206006)(316002)(70586007)(6916009)(478600001)(40480700001)(82310400005)(426003)(2906002)(5660300002)(8676002)(8936002)(6666004)(44832011)(81166007)(82740400003)(36860700001)(26005)(186003)(83380400001)(47076005)(1076003)(2616005)(41300700001)(336012)(7696005)(40460700003);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 10:25:21.1694 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9c6a320f-fc38-48bf-999f-08db58535997 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: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9896 X-Spam-Status: No, score=-11.9 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