From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10059.outbound.protection.outlook.com [40.107.1.59]) by sourceware.org (Postfix) with ESMTPS id B2175389901B for ; Fri, 1 Apr 2022 09:19:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2175389901B Received: from AS8PR04CA0063.eurprd04.prod.outlook.com (2603:10a6:20b:313::8) by AM8PR08MB5586.eurprd08.prod.outlook.com (2603:10a6:20b:1d6::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.25; Fri, 1 Apr 2022 09:19:09 +0000 Received: from VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:313:cafe::73) by AS8PR04CA0063.outlook.office365.com (2603:10a6:20b:313::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.23 via Frontend Transport; Fri, 1 Apr 2022 09:19: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; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT024.mail.protection.outlook.com (10.152.18.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.19 via Frontend Transport; Fri, 1 Apr 2022 09:19:09 +0000 Received: ("Tessian outbound 9613c00560a5:v118"); Fri, 01 Apr 2022 09:19:09 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: a6fd79f055325267 X-CR-MTA-TID: 64aa7808 Received: from 5c5f143f395a.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 601A2599-2429-4FF1-8E0C-7350D98A7332.1; Fri, 01 Apr 2022 09:19:02 +0000 Received: from EUR03-VE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5c5f143f395a.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 01 Apr 2022 09:19:02 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oRQx5wGuQhLpgac0FtBM9vkqX3H+xAEvPchmoihLobx74FrqdRp0z6nLGptTKnWW5CBouic+vRn7blS5c16qgHH2O+3l8nRjxScrNIME4mOlwBFVzXDQG5DfDuKy3Xahd5ea1tvhfbAdfe6DqLGkRz1mbptYobFoKKj+Cb0Fo9CRld3fGHfkp7FmR7hCATXiRlTsMXf6JPkFu2xSAPVaqqeYPm+9VNtG/QXSO5SN8n6/2LluUvzNIJwl6DIPaNSjxL5BKKvQDkPs6+FDKuePRbWTvom58m7ncyMHdx/DO4mM+vKIPEhnwm/wSLUvVJxUlRXxJC9xMh2Gn7CxIeKHXQ== 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=XJ5bnzlsRYxd0dF3kTJPjHfjHb6W9v9mre16tuU9JfY=; b=lf2xzoYU/9KroZYPsoxNTdIC4gc2J/8OwOoVZcgLmzLrmFmIaNbKovuREQ79XGM1a35jQpwA/IOl3dWvLTR55mwxUxUs3A4JpVTcf/DYBALWHenhydV0wku8wFQjW/m26Qfat369jSylwFhAp0wRWi7SZPkM3Mvm+vyTHk0/oxOq7CiVZgAorSknPHPAQrPVe5T6dEsl439PvL43vKa9bhQEaVbjTP9EzLkixYa1PfiLGk3rDBiymLSWrn0XgDA+vYsH+TKrhL8P8WoLjUGSEEIUUByxgCHuqrB/npCBLwSma9n9Y4pJqjaCDGDJ8i5j/FX3ITH4ayBvVfgyzcXYmw== 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 Received: from DB9PR02CA0013.eurprd02.prod.outlook.com (2603:10a6:10:1d9::18) by VI1PR08MB3422.eurprd08.prod.outlook.com (2603:10a6:803:7d::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5102.20; Fri, 1 Apr 2022 09:18:43 +0000 Received: from DB5EUR03FT057.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:1d9:cafe::24) by DB9PR02CA0013.outlook.office365.com (2603:10a6:10:1d9::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5123.26 via Frontend Transport; Fri, 1 Apr 2022 09:18:43 +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; Received: from nebula.arm.com (40.67.248.234) by DB5EUR03FT057.mail.protection.outlook.com (10.152.20.235) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5123.19 via Frontend Transport; Fri, 1 Apr 2022 09:18:43 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) 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.2308.27; Fri, 1 Apr 2022 09:18:39 +0000 Received: from e129018.arm.com (10.57.6.188) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2308.27 via Frontend Transport; Fri, 1 Apr 2022 09:18:39 +0000 From: Christophe Lyon To: CC: , , Christophe Lyon , Christophe Lyon , Christophe Lyon Subject: [PATCH v4 2/5] gdb/arm: Define MSP and PSP registers for M-Profile Date: Fri, 1 Apr 2022 11:18:11 +0200 Message-ID: <20220401091814.2782327-3-christophe.lyon@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220401091814.2782327-1-christophe.lyon@arm.com> References: <20220401091814.2782327-1-christophe.lyon@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-EOPAttributedMessage: 1 X-MS-Office365-Filtering-Correlation-Id: 1472af56-aa40-478c-64b4-08da13c0adb6 X-MS-TrafficTypeDiagnostic: VI1PR08MB3422:EE_|VE1EUR03FT024:EE_|AM8PR08MB5586:EE_ X-Microsoft-Antispam-PRVS: 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: IW2rSfG86XL01b5ZXZgOzFarb97jJt0PnudTe0bdGD0aTto91AZpBuoa2ag1KM7paSgn31Oemj/1WWkYZ5MU6fTT4/iQmVHqEWz/X/eECD7qq0SyyWadJRrkRQz/2X1T3Y9e0+R+imSiair+1O+tk2KkEda6UQeUp3phfM0IZPigQtF7nv1EIALtnSWIAafWzLUKHXh+P0A0e8cJeV87DAbgGQdEVVYitdkWqYJ5Xz0e8KAtwabsMUD0QW3AYKlqqedHZHWlpGVaeZDx21QL+2Ht64szcOpI1OU/jPd9tFSL6xkOjNSG3ZTa7OamlQMfxzSsRgleCb0MOKOaKCW+IAexZAplCrFqUPvHYqOKamYwPb9kj1lKDnueaZexqgFvPOo6ur/wX5i/D2RD8fu0yDz3J8iB64jJwHoZqF4Ls5wQOlRAcHwkDjeQlteyVybLHx0WQXjqZlpx08ZYkpOX7BUPUaUNcTZFtBOiHJKUOMh+DxLL4jh4MVvcdCplCHwfAYSCFM0sEvcvTi3Efsicun8D4sM0JRPx51njbvdRYWkfwKFNTIV0gQ1BHwRVS9AUpXVwzOkNgRmAHn1wvcReG2rfuBGM/DQlKx+aVphZIkVZ51f52wb4LlXEoREftEJG3FH1uKCo79c2eq7ROiKXOrsSvC8s8pJYfKNuhDAUH7m5k3/2uQhbVit8CIxN3zLg2AgmQSV8VXV4iTvFEpoH/wThGx3IlgkEXuOmAojeZVA= 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:(13230001)(4636009)(40470700004)(36840700001)(46966006)(2616005)(83380400001)(1076003)(6666004)(356005)(36860700001)(7696005)(40460700003)(47076005)(86362001)(508600001)(82310400004)(316002)(81166007)(336012)(8936002)(186003)(26005)(36756003)(5660300002)(426003)(4326008)(6916009)(70206006)(44832011)(2906002)(54906003)(70586007)(8676002)(2004002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB3422 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 5810d53b-5bb7-4755-7f99-08da13c09e3c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Vx9s09eFTAQDQR9bA9zkFTNKfkKhWUIFbhWZ6qYc/M5gdIbnMyirUcRCGLlxMEeBsY9+Gdh2ChlhRdf4053SNcIdFYy86u5Bai7rkXq76L1RjTZ8U3gm8VQhlwuKghzVONjsHzjCzsa5Gi2Xj7RTFQoCZhuB4Wzd5iEBY2vN0UhL5x0pJ4qhr59RonafVEbYNlStpvNeBwUA/o4mcc3EUXifUJhq3uMvv0vY5Ip+Ha8kalvm3aMZEAwLntFxfv91sM+zu946cqIYmSrafRyHLLHj39kUpTN1tAZhHTMAv/sFTZC5QNlvtKioV9XHIGTffnbkMYiyZ0b7g7IJBQAmJpYWO2vF3SU0YIJKnW+JE264GK7l1a+PEjX6LRz3NCYGtO9LqRmAjeIY1C9pGNCFbM6d2sWSxutFIXRjgDz6d90y1AdwcT+Qqto0vJrnPDLKfDVAZoOpeqGnEnxYy3kQ6K+c9E/jPNRfbQ737ovdfFMzLkYu6IBcehkmDiXVcxozW55PH5JRXGuvbyeGePjnxhEif2cCn0AmFChWwY/Cm2UOF2B1ukc+wN7ibDMmLPfQKJf84vI3cMEIZJPyxPvHuywohHUUmlWrJzfyHJ4n6PkLBps1dzZM+C0bRpq62Ao/cGBLQqBOGe7HVTbIZsc7CirafN56JM8yH73p1m3gPXd/9jKF5aM7Cr1dTi+8zADtKoDYbxU6pWdymmhZ12wHww== 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:(13230001)(4636009)(46966006)(36840700001)(40470700004)(5660300002)(8936002)(54906003)(81166007)(6916009)(70586007)(4326008)(508600001)(44832011)(40460700003)(316002)(70206006)(83380400001)(8676002)(6666004)(336012)(86362001)(2616005)(1076003)(26005)(186003)(426003)(36860700001)(47076005)(7696005)(2906002)(82310400004)(36756003)(2004002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Apr 2022 09:19:09.4000 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1472af56-aa40-478c-64b4-08da13c0adb6 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: VE1EUR03FT024.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5586 X-Spam-Status: No, score=-13.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Fri, 01 Apr 2022 09:19:20 -0000 From: Christophe Lyon This patch removes the hardcoded access to PSP in arm_m_exception_cache() and relies on the definition with the XML descriptions. Signed-off-by: Christophe Lyon Signed-off-by: Christophe Lyon --- gdb/arch/arm.c | 6 +++ gdb/arch/arm.h | 1 + gdb/arm-tdep.c | 80 ++++++++++++++++++++----------- gdb/arm-tdep.h | 3 ++ gdb/features/Makefile | 1 + gdb/features/arm/arm-m-system.c | 15 ++++++ gdb/features/arm/arm-m-system.xml | 12 +++++ 7 files changed, 89 insertions(+), 29 deletions(-) create mode 100644 gdb/features/arm/arm-m-system.c create mode 100644 gdb/features/arm/arm-m-system.xml diff --git a/gdb/arch/arm.c b/gdb/arch/arm.c index 126e46a950a..bc6e5ce3f09 100644 --- a/gdb/arch/arm.c +++ b/gdb/arch/arm.c @@ -28,6 +28,7 @@ #include "../features/arm/arm-m-profile.c" #include "../features/arm/arm-m-profile-with-fpa.c" #include "../features/arm/arm-m-profile-mve.c" +#include "../features/arm/arm-m-system.c" /* See arm.h. */ @@ -446,6 +447,11 @@ arm_create_mprofile_target_description (arm_m_profile_type m_type) regnum = create_feature_arm_arm_m_profile_mve (tdesc, regnum); break; + case ARM_M_TYPE_SYSTEM: + regnum = create_feature_arm_arm_m_profile (tdesc, regnum); + regnum = create_feature_arm_arm_m_system (tdesc, regnum); + break; + default: error (_("Invalid Arm M type: %d"), m_type); } diff --git a/gdb/arch/arm.h b/gdb/arch/arm.h index f75470e7572..b8f38e61694 100644 --- a/gdb/arch/arm.h +++ b/gdb/arch/arm.h @@ -92,6 +92,7 @@ enum arm_m_profile_type { ARM_M_TYPE_VFP_D16, ARM_M_TYPE_WITH_FPA, ARM_M_TYPE_MVE, + ARM_M_TYPE_SYSTEM, ARM_M_TYPE_INVALID }; diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 9e623057e4a..5faab6b6da6 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3018,9 +3018,9 @@ arm_m_exception_cache (struct frame_info *this_frame) { struct gdbarch *gdbarch = get_frame_arch (this_frame); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); + arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch); struct arm_prologue_cache *cache; CORE_ADDR lr; - CORE_ADDR sp; CORE_ADDR unwound_sp; LONGEST xpsr; uint32_t exc_return; @@ -3036,7 +3036,6 @@ arm_m_exception_cache (struct frame_info *this_frame) to the exception and if FPU is used (causing extended stack frame). */ lr = get_frame_register_unsigned (this_frame, ARM_LR_REGNUM); - sp = get_frame_register_unsigned (this_frame, ARM_SP_REGNUM); /* Check EXC_RETURN indicator bits. */ exc_return = (((lr >> 28) & 0xf) == 0xf); @@ -3045,37 +3044,13 @@ arm_m_exception_cache (struct frame_info *this_frame) process_stack_used = ((lr & (1 << 2)) != 0); if (exc_return && process_stack_used) { - /* Thread (process) stack used. - Potentially this could be other register defined by target, but PSP - can be considered a standard name for the "Process Stack Pointer". - To be fully aware of system registers like MSP and PSP, these could - be added to a separate XML arm-m-system-profile that is valid for - ARMv6-M and ARMv7-M architectures. Also to be able to debug eg a - corefile off-line, then these registers must be defined by GDB, - and also be included in the corefile regsets. */ - - int psp_regnum = user_reg_map_name_to_regnum (gdbarch, "psp", -1); - if (psp_regnum == -1) - { - /* Thread (process) stack could not be fetched, - give warning and exit. */ - - warning (_("no PSP thread stack unwinding supported.")); - - /* Terminate any further stack unwinding by refer to self. */ - cache->prev_sp = sp; - return cache; - } - else - { - /* Thread (process) stack used, use PSP as SP. */ - unwound_sp = get_frame_register_unsigned (this_frame, psp_regnum); - } + /* Thread (process) stack used, use PSP as SP. */ + unwound_sp = get_frame_register_unsigned (this_frame, tdep->m_profile_psp_regnum); } else { /* Main stack used, use MSP as SP. */ - unwound_sp = sp; + unwound_sp = get_frame_register_unsigned (this_frame, tdep->m_profile_msp_regnum); } /* The hardware saves eight 32-bit words, comprising xPSR, @@ -9043,6 +9018,10 @@ arm_register_g_packet_guesses (struct gdbarch *gdbarch) register_remote_g_packet_guess (gdbarch, ARM_CORE_REGS_SIZE + ARM_VFP2_REGS_SIZE + ARM_INT_REGISTER_SIZE, tdesc); + + /* M-profile system (stack pointers). */ + tdesc = arm_read_mprofile_description (ARM_M_TYPE_SYSTEM); + register_remote_g_packet_guess (gdbarch, 2 * ARM_INT_REGISTER_SIZE, tdesc); } /* Otherwise we don't have a useful guess. */ @@ -9103,6 +9082,9 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) bool have_mve = false; int mve_vpr_regnum = -1; int register_count = ARM_NUM_REGS; + bool have_m_profile_msp = false; + int m_profile_msp_regnum = -1; + int m_profile_psp_regnum = -1; /* If we have an object to base this architecture on, try to determine its ABI. */ @@ -9305,6 +9287,35 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (!valid_p) return NULL; + if (is_m) + { + feature = tdesc_find_feature (tdesc, + "org.gnu.gdb.arm.m-system"); + if (feature != nullptr) + { + /* MSP */ + valid_p &= tdesc_numbered_register (feature, tdesc_data.get (), + register_count, "msp"); + if (!valid_p) + { + warning (_("M-profile m-system feature is missing required register msp.")); + return nullptr; + } + have_m_profile_msp = true; + m_profile_msp_regnum = register_count++; + + /* PSP */ + valid_p &= tdesc_numbered_register (feature, tdesc_data.get (), + register_count, "psp"); + if (!valid_p) + { + warning (_("M-profile m-system feature is missing required register psp.")); + return nullptr; + } + m_profile_psp_regnum = register_count++; + } + } + feature = tdesc_find_feature (tdesc, "org.gnu.gdb.arm.fpa"); if (feature != NULL) @@ -9504,6 +9515,13 @@ arm_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) tdep->mve_vpr_regnum = mve_vpr_regnum; } + /* Adjust the M-profile stack pointers settings. */ + if (have_m_profile_msp) + { + tdep->m_profile_msp_regnum = m_profile_msp_regnum; + tdep->m_profile_psp_regnum = m_profile_psp_regnum; + } + arm_register_g_packet_guesses (gdbarch); /* Breakpoints. */ @@ -9776,6 +9794,10 @@ arm_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) tdep->mve_pseudo_base); fprintf_filtered (file, _("arm_dump_tdep: mve_pseudo_count = %i\n"), tdep->mve_pseudo_count); + fprintf_filtered (file, _("arm_dump_tdep: m_profile_msp_regnum = %i\n"), + tdep->m_profile_msp_regnum); + fprintf_filtered (file, _("arm_dump_tdep: m_profile_psp_regnum = %i\n"), + tdep->m_profile_psp_regnum); fprintf_filtered (file, _("arm_dump_tdep: Lowest pc = 0x%lx\n"), (unsigned long) tdep->lowest_pc); } diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index 8a9f618539f..c6aaf929a8a 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -119,6 +119,9 @@ struct arm_gdbarch_tdep : gdbarch_tdep int mve_pseudo_base = 0; /* Number of the first MVE pseudo register. */ int mve_pseudo_count = 0; /* Total number of MVE pseudo registers. */ + int m_profile_msp_regnum = 0; /* M-profile MSP register number. */ + int m_profile_psp_regnum = 0; /* M-profile PSP register number. */ + bool is_m = false; /* Does the target follow the "M" profile. */ CORE_ADDR lowest_pc = 0; /* Lowest address at which instructions will appear. */ diff --git a/gdb/features/Makefile b/gdb/features/Makefile index 68e17d0085d..9883c21860c 100644 --- a/gdb/features/Makefile +++ b/gdb/features/Makefile @@ -206,6 +206,7 @@ FEATURE_XMLFILES = aarch64-core.xml \ arm/arm-fpa.xml \ arm/arm-m-profile.xml \ arm/arm-m-profile-mve.xml \ + arm/arm-m-system.xml \ arm/arm-m-profile-with-fpa.xml \ arm/arm-vfpv2.xml \ arm/arm-vfpv3.xml \ diff --git a/gdb/features/arm/arm-m-system.c b/gdb/features/arm/arm-m-system.c new file mode 100644 index 00000000000..3fb20a57198 --- /dev/null +++ b/gdb/features/arm/arm-m-system.c @@ -0,0 +1,15 @@ +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: + Original: arm-m-system.xml */ + +#include "gdbsupport/tdesc.h" + +static int +create_feature_arm_arm_m_system (struct target_desc *result, long regnum) +{ + struct tdesc_feature *feature; + + feature = tdesc_create_feature (result, "org.gnu.gdb.arm.m-system"); + tdesc_create_reg (feature, "msp", regnum++, 1, NULL, 32, "data_ptr"); + tdesc_create_reg (feature, "psp", regnum++, 1, NULL, 32, "data_ptr"); + return regnum; +} diff --git a/gdb/features/arm/arm-m-system.xml b/gdb/features/arm/arm-m-system.xml new file mode 100644 index 00000000000..eb167adb21a --- /dev/null +++ b/gdb/features/arm/arm-m-system.xml @@ -0,0 +1,12 @@ + + + + + + + + -- 2.17.1