From patchwork Fri Jul 5 09:45:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Hayward X-Patchwork-Id: 33599 Received: (qmail 128546 invoked by alias); 5 Jul 2019 09:45:55 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 128511 invoked by uid 89); 5 Jul 2019 09:45:54 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-23.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=HAccept-Language:en-GB X-HELO: EUR02-VE1-obe.outbound.protection.outlook.com Received: from mail-eopbgr20073.outbound.protection.outlook.com (HELO EUR02-VE1-obe.outbound.protection.outlook.com) (40.107.2.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 05 Jul 2019 09:45:50 +0000 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=Eq4qazIGqwwmgc07IEEKZ8ziNKzyeXp2XDkuGwfblwU=; b=M28MYXnozpQ3+Blvp0uoi6zACJ4E3QyJW65TMbO93oy6MqBs94ob2cwQ/v0OkPP+ZzvRG1Sh0+qX7rNJNiaV9/JgTWHqaTlu38WERRaIP79YBVTaOvSZx7oSHb0u3S3gfPPRZHSo0cBCFHW6E/DYS7q0snVsSwRiMyZZhB2R/aI= Received: from HE1PR0802CA0001.eurprd08.prod.outlook.com (2603:10a6:3:bd::11) by VI1PR0801MB1855.eurprd08.prod.outlook.com (2603:10a6:800:59::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Fri, 5 Jul 2019 09:45:44 +0000 Received: from AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e08::208) by HE1PR0802CA0001.outlook.office365.com (2603:10a6:3:bd::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Fri, 5 Jul 2019 09:45:43 +0000 Authentication-Results: spf=temperror (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT045.mail.protection.outlook.com (10.152.17.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.2052.18 via Frontend Transport; Fri, 5 Jul 2019 09:45:42 +0000 Received: ("Tessian outbound a1cd17a9f69b:v23"); Fri, 05 Jul 2019 09:45:42 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2794b54ec1b1a3b9 X-CR-MTA-TID: 64aa7808 Received: from 7ecfcbd9f912.9 (cr-mta-lb-1.cr-mta-net [104.47.13.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 02C652AF-6AB3-4D2F-8B93-4EF031A1E77E.1; Fri, 05 Jul 2019 09:45:36 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04lp2053.outbound.protection.outlook.com [104.47.13.53]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 7ecfcbd9f912.9 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Fri, 05 Jul 2019 09:45:36 +0000 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=Eq4qazIGqwwmgc07IEEKZ8ziNKzyeXp2XDkuGwfblwU=; b=M28MYXnozpQ3+Blvp0uoi6zACJ4E3QyJW65TMbO93oy6MqBs94ob2cwQ/v0OkPP+ZzvRG1Sh0+qX7rNJNiaV9/JgTWHqaTlu38WERRaIP79YBVTaOvSZx7oSHb0u3S3gfPPRZHSo0cBCFHW6E/DYS7q0snVsSwRiMyZZhB2R/aI= Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com (10.172.227.22) by DB6PR0802MB2472.eurprd08.prod.outlook.com (10.172.251.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2032.20; Fri, 5 Jul 2019 09:45:35 +0000 Received: from DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::259b:8edf:fb65:2760]) by DB6PR0802MB2133.eurprd08.prod.outlook.com ([fe80::259b:8edf:fb65:2760%8]) with mapi id 15.20.2052.010; Fri, 5 Jul 2019 09:45:35 +0000 From: Alan Hayward To: "gdb-patches@sourceware.org" CC: nd , Alan Hayward Subject: [PATCH 4/7] Arm: Use feature target descriptions Date: Fri, 5 Jul 2019 09:45:34 +0000 Message-ID: <20190705094525.51536-5-alan.hayward@arm.com> References: <20190705094525.51536-1-alan.hayward@arm.com> In-Reply-To: <20190705094525.51536-1-alan.hayward@arm.com> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; X-Microsoft-Antispam-Untrusted: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020); SRVR:DB6PR0802MB2472; x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:5516;OLM:5516; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM; SFS:(10009020)(4636009)(376002)(396003)(366004)(346002)(39860400002)(136003)(54534003)(189003)(199004)(68736007)(73956011)(44832011)(5660300002)(66946007)(66446008)(305945005)(66556008)(478600001)(6116002)(6916009)(25786009)(446003)(2906002)(3846002)(2616005)(50226002)(476003)(486006)(64756008)(66476007)(7736002)(2351001)(8936002)(86362001)(36756003)(53936002)(102836004)(4326008)(52116002)(81156014)(26005)(256004)(14454004)(76176011)(6512007)(6436002)(186003)(6486002)(81166006)(8676002)(1076003)(2501003)(71190400001)(316002)(11346002)(99286004)(54906003)(66066001)(5640700003)(6506007)(386003)(71200400001)(72206003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2472; H:DB6PR0802MB2133.eurprd08.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info-Original: 2pLxCV46edeehXvfDwGY6VW/Y2gN2PxWRmE8q2D2liO8GMlbfZz4r796zo46wPICtcE1AxOv914dC6MEV5060aM3f5FZudhDVghmWPDcH4iV/tOJh26bmC6+Vb74RnZkFqf/hOm8UBHOJzaPEMDDQ4aWYH6IDmIkyBqdxF1XC6/2S9uoevY2cjR62DAMtYH3GRZLfMJ09akUrAmDc1XDpSeGbSq1OY3HOm7+gXkZcyi4C+XfKWRceRYK8Pdgj4ovU27P31NDegIArEKqYPQJLMrMXl2m9emyRvC6D9WzQPWgPT9EL9da708May9b01yXRUL9lstOg4eKj/Srlrs7yctcQizBEexShiYEkXK/QARLqiiuyk4euy/wBvE8uFcILxKv4q3iIvFZTy1fopcbNMVhEVkoq39VotpX0qQnXeM= MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Alan.Hayward@arm.com; Return-Path: Alan.Hayward@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT045.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: a6865891-c4b6-4581-42f7-08d7012d86ed X-IsSubscribed: yes In arm arm_create_target_description and aarch32_create_target_description create feature based target descriptions instead of returning the old style descriptions. Ensure the descriptions are created in exactly the same way as the old xml files. Remove the old initialize calls. Note this fixes the gdbserver build for AArch64. gdb/ChangeLog: 2019-07-05 Alan Hayward * arch/aarch32.c (aarch32_create_target_description): Create target descriptions using features. * arch/arm.c (arm_create_target_description) (arm_create_mprofile_target_description): Likewise. * arm-tdep.c (_initialize_arm_tdep): Remove tdesc init calls. --- gdb/arch/aarch32.c | 18 +++++++++++-- gdb/arch/arm.c | 63 +++++++++++++++++++++++++++++++++------------- gdb/arm-tdep.c | 17 ------------- 3 files changed, 62 insertions(+), 36 deletions(-) diff --git a/gdb/arch/aarch32.c b/gdb/arch/aarch32.c index f3cb8c7855..f15096e592 100644 --- a/gdb/arch/aarch32.c +++ b/gdb/arch/aarch32.c @@ -18,12 +18,26 @@ #include "common/common-defs.h" #include "aarch32.h" -extern struct target_desc *tdesc_arm_with_neon; +#include "../features/arm/arm-core.c" +#include "../features/arm/arm-vfpv3.c" /* See aarch32.h. */ target_desc * aarch32_create_target_description () { - return tdesc_arm_with_neon; + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + + regnum = create_feature_arm_arm_core (tdesc, regnum); + /* Create a vfpv3 feature, then a blank NEON feature. */ + regnum = create_feature_arm_arm_vfpv3 (tdesc, regnum); + tdesc_create_feature (tdesc, "org.gnu.gdb.arm.neon"); + + return tdesc; } diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c index 37806753cb..e563457942 100644 --- a/gdb/arch/arm.c +++ b/gdb/arch/arm.c @@ -21,14 +21,12 @@ #include "common/common-regcache.h" #include "arm.h" -extern struct target_desc *tdesc_arm_with_vfpv2; -extern struct target_desc *tdesc_arm_with_vfpv3; -extern struct target_desc *tdesc_arm_with_iwmmxt; -#ifndef GDBSERVER -extern struct target_desc *tdesc_arm_with_m; -extern struct target_desc *tdesc_arm_with_m_vfp_d16; -extern struct target_desc *tdesc_arm_with_m_fpa_layout; -#endif +#include "../features/arm/arm-core.c" +#include "../features/arm/arm-vfpv2.c" +#include "../features/arm/arm-vfpv3.c" +#include "../features/arm/xscale-iwmmxt.c" +#include "../features/arm/arm-m-profile.c" +#include "../features/arm/arm-m-profile-with-fpa.c" /* See arm.h. */ @@ -387,23 +385,41 @@ shifted_reg_val (struct regcache *regcache, unsigned long inst, target_desc * arm_create_target_description (arm_fp_type fp_type) { + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + if (fp_type == ARM_FP_TYPE_IWMMXT) + set_tdesc_architecture (tdesc, "iwmmxt"); + else + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + + regnum = create_feature_arm_arm_core (tdesc, regnum); + switch (fp_type) { case ARM_FP_TYPE_NONE: - return nullptr; + break; case ARM_FP_TYPE_VFPV2: - return tdesc_arm_with_vfpv2; + regnum = create_feature_arm_arm_vfpv2 (tdesc, regnum); + break; case ARM_FP_TYPE_VFPV3: - return tdesc_arm_with_vfpv3; + regnum = create_feature_arm_arm_vfpv3 (tdesc, regnum); + break; case ARM_FP_TYPE_IWMMXT: - return tdesc_arm_with_iwmmxt; + regnum = create_feature_arm_xscale_iwmmxt (tdesc, regnum); + break; default: error (_("Invalid Arm FP type: %d"), fp_type); } + + return tdesc; } /* See arch/arm.h. */ @@ -411,19 +427,32 @@ arm_create_target_description (arm_fp_type fp_type) target_desc * arm_create_mprofile_target_description (arm_m_profile_type m_type) { + target_desc *tdesc = allocate_target_description (); + +#ifndef IN_PROCESS_AGENT + set_tdesc_architecture (tdesc, "arm"); +#endif + + long regnum = 0; + switch (m_type) { -#ifndef GDBSERVER case ARM_M_TYPE_M_PROFILE: - return tdesc_arm_with_m; + regnum = create_feature_arm_arm_m_profile (tdesc, regnum); + break; case ARM_M_TYPE_VFP_D16: - return tdesc_arm_with_m_fpa_layout; + regnum = create_feature_arm_arm_m_profile (tdesc, regnum); + regnum = create_feature_arm_arm_vfpv2 (tdesc, regnum); + break; case ARM_M_TYPE_WITH_FPA: - return tdesc_arm_with_m_vfp_d16; -#endif + regnum = create_feature_arm_arm_m_profile_with_fpa (tdesc, regnum); + break; + default: error (_("Invalid Arm M type: %d"), m_type); } + + return tdesc; } diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index f3f6458a27..91a4a785ea 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -61,14 +61,6 @@ #include "record-full.h" #include -#include "features/arm/arm-with-m.c" -#include "features/arm/arm-with-m-fpa-layout.c" -#include "features/arm/arm-with-m-vfp-d16.c" -#include "features/arm/arm-with-iwmmxt.c" -#include "features/arm/arm-with-vfpv2.c" -#include "features/arm/arm-with-vfpv3.c" -#include "features/arm/arm-with-neon.c" - #if GDB_SELF_TEST #include "common/selftest.h" #endif @@ -9479,15 +9471,6 @@ _initialize_arm_tdep (void) bfd_target_elf_flavour, arm_elf_osabi_sniffer); - /* Initialize the standard target descriptions. */ - initialize_tdesc_arm_with_m (); - initialize_tdesc_arm_with_m_fpa_layout (); - initialize_tdesc_arm_with_m_vfp_d16 (); - initialize_tdesc_arm_with_iwmmxt (); - initialize_tdesc_arm_with_vfpv2 (); - initialize_tdesc_arm_with_vfpv3 (); - initialize_tdesc_arm_with_neon (); - /* Add root prefix command for all "set arm"/"show arm" commands. */ add_prefix_cmd ("arm", no_class, set_arm_command, _("Various ARM-specific commands."),