From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id XQODGpekqWK/TwIAWB0awg (envelope-from ) for ; Wed, 15 Jun 2022 05:21:27 -0400 Received: by simark.ca (Postfix, from userid 112) id 5769B1E224; Wed, 15 Jun 2022 05:21:27 -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=aI3oC9v0; 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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.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 DA6891E15D for ; Wed, 15 Jun 2022 05:21:26 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83CE0384D1B7 for ; Wed, 15 Jun 2022 09:21:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 83CE0384D1B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1655284885; bh=pjAd335hgZUG26ZF78cPw74oj7NwxeLIQKJzsTUWxUE=; 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=aI3oC9v0l1Oeu1ShslsayhmwyGNphtAmzgZy0S0ymOfQXVM3X4JJJxz8W6620MbNO J5xgjleJhDKpPPYfEs0Z/Kfu3/q73L5ubiK4Uj3p2K6fl5de2nSj9CKyA72K0vY74e vY3WJbuybLw5v2wpT/oJeCdyjH17ZAisZkE3ZjnY= Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [185.132.182.106]) by sourceware.org (Postfix) with ESMTPS id 069CB3856265 for ; Wed, 15 Jun 2022 09:21:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 069CB3856265 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25F8Z6Xk029267; Wed, 15 Jun 2022 11:21:00 +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 3gmgfmt3cy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 15 Jun 2022 11:21:00 +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 5A71E10002A; Wed, 15 Jun 2022 11:20:59 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 36F47214D23; Wed, 15 Jun 2022 11:20:59 +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; Wed, 15 Jun 2022 11:20:56 +0200 Date: Wed, 15 Jun 2022 11:20:55 +0200 To: Luis Machado , Subject: Re: [PATCH 1/3] gdb/arm: Fetch initial sp value prior to compare Message-ID: <20220615092055.GA26132@gnbcxd0114.gnb.st.com> References: <20220614145606.GB12000@gnbcxd0114.gnb.st.com> <20220614145922.GC12000@gnbcxd0114.gnb.st.com> <17271abd-9c22-dae1-8ac6-9b549ff1f686@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <17271abd-9c22-dae1-8ac6-9b549ff1f686@arm.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-15_03,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" On Wed, Jun 15, 2022 at 09:39:21AM +0100, Luis Machado wrote: > On 6/14/22 15:59, Yvan Roux wrote: > > 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) > > { > > Does that mean that before this patch the value of cache->sp was uninitialized? Yes, what Torbjorn found is that arm_prologue_cache->sp value was 0x0 due to lack of initialization. -- Y.