From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 8eSjDgFWl2ketwEAWB0awg (envelope-from ) for ; Thu, 19 Feb 2026 13:27:13 -0500 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=hZ6HXE8H; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 36FCC1E0BA; Thu, 19 Feb 2026 13:27:13 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 8576F1E08D for ; Thu, 19 Feb 2026 13:27:12 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id A7EBA4BA2E0B for ; Thu, 19 Feb 2026 18:27:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7EBA4BA2E0B Authentication-Results: sourceware.org; dkim=fail reason="signature verification failed" (768-bit key, unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=hZ6HXE8H Received: from omta40.uswest2.a.cloudfilter.net (omta40.uswest2.a.cloudfilter.net [35.89.44.39]) by sourceware.org (Postfix) with ESMTPS id 564674B9DB57 for ; Thu, 19 Feb 2026 18:26:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 564674B9DB57 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 564674B9DB57 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.39 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771525583; cv=none; b=LfU/FX49y581ald+r4ebr2/tFGr0TBDVKi/qN7vytLVRPhE3m0RJ3FMI05d8UyvkMjW2S91H2zvsq2ktQ2nre5/5+9fFqScA5dwik/Ea/RysfadTh1hYDvENL1wX/7r5ARmQsNxvUyv2DsBcsxul3jDcGX3m+EzjarWu84++l/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1771525583; c=relaxed/simple; bh=QFsO2JRcipjHh6HqoX3KXVWFbjOgml2AjoPSVXZrDpY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=hAlW+Q0YzhOqOhG+i+AodRF9P4V2UhkfXjcQLTJyGoc5/OipGW+DhDPcidGb19acGPC0JLzZ0lnw79mUhar9ipau0/RRMzdkjIsh0YCPSCU2o8xxHB9fvVuOl5EcT4HaQQEWBBwTOdPKKgeRTNVVjs1D10TtP8Ruan6utP6dvPs= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 564674B9DB57 Received: from eig-obgw-6006b.ext.cloudfilter.net ([10.0.30.211]) by cmsmtp with ESMTPS id t7Oiv8zECaPqLt8jGv9zWp; Thu, 19 Feb 2026 18:26:22 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id t8jFv5VGfvXvHt8jFvucU8; Thu, 19 Feb 2026 18:26:21 +0000 X-Authority-Analysis: v=2.4 cv=e4IGSbp/ c=1 sm=1 tr=0 ts=699755ce a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=HzLeVaNsDn8A:10 a=ItBw4LHWJt0A:10 a=QyXUC8HyAAAA:8 a=Sgvjz3OR-60MKOHTEWcA:9 a=DCx65vhANUyCzuf5D8fC:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=StM7jpXdH7BRTC+RQUEwAc0KtG7YM0Gbfv9fGs/c75A=; b=hZ6HXE8H7DxZ44OB04DxjbxQL2 JTRKWIoQbkGxhx8kwsviPPz9gTVKNjuQ9HxTAXD+/VnoVcqPPO4QHgmZmd5+QOoaptZZTtPnR+IT0 jrcVCQng4oP0bT+jLf1mfGzkO; Received: from 97-122-122-234.hlrn.qwest.net ([97.122.122.234]:43682 helo=bapiya) by box5379.bluehost.com with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vt8jF-00000002PjL-0F3G; Thu, 19 Feb 2026 11:26:21 -0700 From: Tom Tromey To: Christina Schimpe Cc: gdb-patches@sourceware.org, thiago.bauermann@linaro.org Subject: Re: [PATCH v2 9/9] gdb, mi: Add -shadow-stack-list-frames command In-Reply-To: <20260123080532.878738-10-christina.schimpe@intel.com> (Christina Schimpe's message of "Fri, 23 Jan 2026 08:05:31 +0000") References: <20260123080532.878738-1-christina.schimpe@intel.com> <20260123080532.878738-10-christina.schimpe@intel.com> X-Attribution: Tom Date: Thu, 19 Feb 2026 11:26:18 -0700 Message-ID: <875x7s614l.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.122.234 X-Source-L: No X-Exim-ID: 1vt8jF-00000002PjL-0F3G X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-122-234.hlrn.qwest.net (bapiya) [97.122.122.234]:43682 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfAkuvxaclSSAhlhNI33ea3NtN59r1oWruMV4+jG/foSPAyVLUR0G+0qxUX0xNgDwOf4WzqIB/oaFlK+0SYhPwUY8vE4HGszif78QCV/vRzhdHDSlU+zO 6AhQBwdg1v9axMAtg2g/SAOkwQSRKJ23LsLyjequHsFLEytkOMamEL4o5UA7/SrMP6SvVsDfiTfsT+wM7dnP0a9SvuOJteD4S3w= X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org >>>>> Christina Schimpe writes: > +void > +mi_cmd_shadow_stack_list_frames (const char *command, > + const char *const *argv, > + int argc) > + /* Check if START_SSP points to a shadow stack memory range and use > + the returned range to determine when to stop unwinding. > + Note that a shadow stack memory range can change, due to shadow stack > + switches for instance on x86 for an inter-privilege far call or when > + calling an interrupt/exception handler at a higher privilege level. > + Shadow stack for userspace is supported for amd64 linux starting with > + Linux kernel v6.6. However, shadow stack switches are not supported > + due to missing kernel space support. We therefore implement this > + command without support for shadow stack switches for now. */ > + std::pair range; > + if (!gdbarch_address_in_shadow_stack_memory_range (gdbarch, *start_ssp, > + &range)) > + { > + /* If START_SSP points off the shadow stack memory range, we cannot > + print the shadow stack backtrace. This is possible, for > + instance, on x86 if NEW_SSP points to the end of RANGE which > + means that the shadow stack is empty. */ > + return; > + } It seems like more of this could be shared with the earlier patch. Replicating a lot of the logic doesn't seem good. The gdb_printfs in the other code can be handled by changing them to use ui_out::text or ui_out::message instead. > + if (!curr.has_value ()) > + error (_("-shadow-stack-list-frames: Not enough frames on the shadow " > + "stack.")); For things like this maybe the API has to be changed a little but that seems fine. Tom