From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id mSsSNuqI0mikMg8AWB0awg (envelope-from ) for ; Tue, 23 Sep 2025 07:47:54 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=mZ0ZsbMy; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CA29C1E047; Tue, 23 Sep 2025 07:47:54 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 server2.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 ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id EF5B31E047 for ; Tue, 23 Sep 2025 07:47:53 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8A4183858C78 for ; Tue, 23 Sep 2025 11:47:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A4183858C78 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=mZ0ZsbMy Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 03E59385841B for ; Tue, 23 Sep 2025 11:47:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03E59385841B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 03E59385841B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758628032; cv=none; b=pAiF129gnw1fU66aoPDCF28fhyreJZ8eAzz5kldXJjPJiFrpxhNn9eqbpKL33aQ6EYf+dJD/wFWC+iORSXK7iQE6r0wZnxiLZVklIqeqq7mZYAZJJ8jqvuHErWKBdAV7yg16lLuVI2FnLWiaRPaErXdhogp1pd9UpT6HusSPCgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758628032; c=relaxed/simple; bh=4XZAW37nQ/YlbfCI6bCj7q0frZk9N0koOBSgcdpIpno=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=A4E62/rmSJ4lQbrqBGW8QF/3f1aXMNT1veWl9Y9gN22z67xjZma7M27I/VggGgUDFO0J6P3hU/qgb6K9QNtrsEzWPJ7MOIFsLwxSrLsUg//uhNKL3VFPSMAVJkuGNTQMoE1uCpl8x9VkFVrEG2UiOkPK1sNEWPlXbNWOaZfwf24= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 03E59385841B Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v11UD-0001ZE-7d; Tue, 23 Sep 2025 07:47:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=mY17xWZeh/JdAo4pUFLSgE0fxBuTaQibeKPsC0+2oXo=; b=mZ0ZsbMy6Fnp OAPhJnzUs3sKHJ6m+8rtLhyhqNl4QmsP1w2+FmOFH6m1UH+71MJB9EnFZW70SVCKgtq74wgvL5cci rb/uVpNE/VgItrNNNr3A0lZRAr00c/a9oSO5aM0YqmuJyTdIOWHh1LILMiMNuQz2ERW+zWalqp+BO KmurzLI8v6BJtn2qf98kAFmEDi6OXwmCrqIxLRbiA9Ftu1p8hQqC/3BOVn1urpo4DNRbxvR3pEksU zUYkK0rLpGmfZ9O4B/Y4sz5JU0AGXIOSdxPLU4js85jcmyOoVSWLkiB/B/PDVoUBQ5E1kLub1mOs5 n0Cy6rcF1oEBPVj5G6iMNw==; Date: Tue, 23 Sep 2025 14:47:01 +0300 Message-Id: <86y0q5crwq.fsf@gnu.org> From: Eli Zaretskii To: Christina Schimpe Cc: gdb-patches@sourceware.org In-Reply-To: <20250923111842.4091694-7-christina.schimpe@intel.com> (message from Christina Schimpe on Tue, 23 Sep 2025 11:18:39 +0000) Subject: Re: [PATCH 6/9] gdb: Implement 'bt shadow' to print the shadow stack backtrace. References: <20250923111842.4091694-1-christina.schimpe@intel.com> <20250923111842.4091694-7-christina.schimpe@intel.com> 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 > From: Christina Schimpe > Date: Tue, 23 Sep 2025 11:18:39 +0000 > > Add a subcommand 'bt shadow' for the ordinary backtrace command which > prints the shadow stack backtrace. > Similar to the ordinary backtrace command 'bt shadow' can be configured > using COUNT and the command line option -frame-info. However, we always > print the address and the command is not affected by the setting > "print address" as well as the setting "print frame-info location-and-address". > Also we do not print the frame arguments. > > Usage: backtrace|bt shadow [OPTION]... [COUNT | -COUNT] > > Help output: > ~~ > (gdb) help bt shadow > Print backtrace of all shadow stack frames, or innermost COUNT frames. > Usage: backtrace shadow [OPTION]... [COUNT | -COUNT] Thanks, but I wonder if this UI is the best we can come up with. The "backtrace" command doesn't currently have non-option arguments except COUNT. We have just got rid of qualifier arguments like "full" and "hide". Instead of introducing qualifier arguments anew, why not go the way of thread-related commands and add a new command "shadow", so the user could say "shadow backtrace" and maybe in the future also other sub-commands? Also, a question: can I say something like "thread apply 1-10 bt shadow"? > +* New commands > + > +backtrace shadow [option]... [count | -count] > +bt shadow [option]... [count | -count] > + Print backtrace of all shadow stack frames, or innermost 'count' frames. > + The command is a subcommand of the ordinary backtrace command. > + > *** Changes in GDB 17 This part is okay (subject to the general comment above). > +This is how a shadow stack backtrace looks like on amd64: > +@smallexample > +@group > +#0 0x000000000040111f in call1 at amd64-shadow-stack.c:14 > +#1 0x000000000040112f in main at amd64-shadow-stack.c:21 > +#2 0x00007ffff7c3fe70 in __libc_start_call_main at ../sysdeps/nptl/libc_start_call_main.h:58 This line is too long. Since this is just an example, I suggest to make it artificially shorter by editing the names of the functions and file names. Reviewed-By: Eli Zaretskii