From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 9YsmJGaiqGIFIQIAWB0awg (envelope-from ) for ; Tue, 14 Jun 2022 10:59:50 -0400 Received: by simark.ca (Postfix, from userid 112) id 7E92D1E224; Tue, 14 Jun 2022 10:59:50 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=i5h2ZT+I; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1839D1E143 for ; Tue, 14 Jun 2022 10:59:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C733384D1A8 for ; Tue, 14 Jun 2022 14:59:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C733384D1A8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1655218789; bh=KV9bw2p3BUwma30D9e5t9G/rhuNnEC3y8lyU7j02yWU=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=i5h2ZT+It4Uj7pwmYBD6F1f0tlWUcjl1hGFjtmCYa+cONYhMwdVb8C00bnMp+4Yvr tZUSaW6NYvMedi/eoEi/gQWtWfC8HchpYVNoCYkas45Kyhr++48OlEWE6+F2M6U5GX dym8pLR5XxwDRZm4pxk8WiBH6bMrJqX/x9oWK28M= Received: from mx07-00178001.pphosted.com (mx08-00178001.pphosted.com [91.207.212.93]) by sourceware.org (Postfix) with ESMTPS id 725103852765 for ; Tue, 14 Jun 2022 14:59:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 725103852765 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25EBZJDb025393; Tue, 14 Jun 2022 16:59:26 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gp2tyj023-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 14 Jun 2022 16:59:26 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3641310002A; Tue, 14 Jun 2022 16:59:26 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 326AA229A80; Tue, 14 Jun 2022 16:59:26 +0200 (CEST) Received: from gnbcxd0114.gnb.st.com (10.129.178.234) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 14 Jun 2022 16:59:23 +0200 Date: Tue, 14 Jun 2022 16:59:22 +0200 To: Subject: [PATCH 1/3] gdb/arm: Fetch initial sp value prior to compare Message-ID: <20220614145922.GC12000@gnbcxd0114.gnb.st.com> References: <20220614145606.GB12000@gnbcxd0114.gnb.st.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220614145606.GB12000@gnbcxd0114.gnb.st.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.129.178.234] X-ClientProxiedBy: SHFCAS1NODE1.st.com (10.75.129.72) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-14_05,2022-06-13_01,2022-02-23_01 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: , From: Yvan Roux via Gdb-patches Reply-To: Yvan Roux Cc: Torbjorn SVENSSON Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" For Arm Cortex-M33 with security extensions, there are 4 different stack pointers (msp_s, msp_ns, psp_s, psp_ns). In order to identify the active one, compare the values of the different stacks. The value of the initial sp register needs to be fetched to perform this comparison. Signed-off-by: Torbjörn SVENSSON Signed-off-by: Yvan Roux --- gdb/arm-tdep.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 456649afdaa..1df57f5b5c8 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -341,6 +341,7 @@ arm_cache_init (struct arm_prologue_cache *cache, struct frame_info *frame) arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch); arm_cache_init (cache, gdbarch); + cache->sp = get_frame_register_unsigned (frame, ARM_SP_REGNUM); if (tdep->have_sec_ext) { -- 2.17.1