From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id oUJNN8JY1Wgg8hIAWB0awg (envelope-from ) for ; Thu, 25 Sep 2025 10:59:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1758812354; bh=ljop9/rHo0CXJNtCad9evb36xVDOntJM/nK0mYboWjM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=o1lOpiGT3Usj3BU0N5E21HeNAYZ3NWjPwqqeuoRNoKlcAvEOyN9mU1YxmWdyw8L4U ypB7/8A/Tt0OU6lbZ9VBJGmVaX4J7WIx/VKUtvYMMgXD+zwGGRABlw0ZFDYZrHtA1K xUGNyBNanFPF+iJL9Mnbo2Y5tlwpPM/HUhOU6/m8= Received: by simark.ca (Postfix, from userid 112) id D01821E047; Thu, 25 Sep 2025 10:59:14 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, 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 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=PHo1Y+zq; dkim-atps=neutral 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 0EAF71E047 for ; Thu, 25 Sep 2025 10:59:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A224B3858286 for ; Thu, 25 Sep 2025 14:59:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A224B3858286 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=PHo1Y+zq Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id CA7F13858D21 for ; Thu, 25 Sep 2025 14:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CA7F13858D21 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CA7F13858D21 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758812322; cv=none; b=i2G5wXUHPTylPMNPzCJeo78bD0qZI7UT1MPXYReJPyqwmORKJigTvJGp6t5FrIVa4o+uC1JIKjqtOdxmjsuoHmz6k4XMOi/8qvEJOx20bzNsa48qfCCKWBb0EVNHNI/lChKyN5Kq2VkI4aWfqLChuJlVzr4yjhlVBsU9jSIuIvI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758812322; c=relaxed/simple; bh=ljop9/rHo0CXJNtCad9evb36xVDOntJM/nK0mYboWjM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=CyS/UBDddWCdZfwG6K5B4V29hdQPIZ3j7xvOzk81EdVaZecpepd5RsZRPu+shQIxOoAxuqldGovtBnSleJH5A5C3P6DgdLxQabUWnwHnVjjvpVZX3kl52fGogkoPMN+lE9PusLC1paNhWrOWlmDbLsyJqoCFsbXcy200I7OGPNw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CA7F13858D21 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1758812322; bh=ljop9/rHo0CXJNtCad9evb36xVDOntJM/nK0mYboWjM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=PHo1Y+zqqJ/nVSq8eI3bmvFYvY7Xxt58gJtZSdZwAZ8hj/arUs5cOxvC4/qw7q/zv /i0CrnEj0pr7/ObMg0rSkI8U2QY2nqSTNhGCFrWSgC/dK2RKxir/ncJdKojKES555X CVV6eLfvVFDLn1sEv08/G0IPz183/MKoZ+CDp/Ek= Received: by simark.ca (Postfix) id 0B23C1E047; Thu, 25 Sep 2025 10:58:42 -0400 (EDT) Message-ID: <3b44b772-7936-4c39-b743-716f585bd334@simark.ca> Date: Thu, 25 Sep 2025 10:58:41 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 6/9] gdb: Implement 'bt shadow' to print the shadow stack backtrace. To: Eli Zaretskii , "Schimpe, Christina" Cc: gdb-patches@sourceware.org, thiago.bauermann@linaro.org References: <20250923111842.4091694-1-christina.schimpe@intel.com> <20250923111842.4091694-7-christina.schimpe@intel.com> <86y0q5crwq.fsf@gnu.org> <86plbebrf1.fsf@gnu.org> Content-Language: fr From: Simon Marchi In-Reply-To: <86plbebrf1.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 On 9/25/25 9:19 AM, Eli Zaretskii wrote: >> From: "Schimpe, Christina" >> CC: "gdb-patches@sourceware.org" , "Thiago Jung >> Bauermann" >> Date: Thu, 25 Sep 2025 11:06:32 +0000 >> >>>> (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. >> >> Hm, not sure if I fully understand what you mean by non-option arguments. >> "bt shadow" does not introduce more non-option arguments, except if you say >> that "shadow" itself is interpreted as "non-option" argument. > > That's what I'm saying, yes. > >>> 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? >> >> This has been discussed in a thread years ago: >> https://sourceware.org/pipermail/gdb/2023-December/051024.html >> The direction was to make it part of the ordinary bt command. > > OK, if that's what the others want... My initial reaction was: why not use a "-shadow" option to the backtrace command, instead of introducing "backtrace shadow", which is effectively a separate command? I then re-read the thread above, and I saw that "-shadow" was actually part of the options considered, and even seemed like the preferred option of many. I didn't see "backtrace shadow" proposed there, so I'm confused. The thing I don't like about "backtrace shadow" is: I don't like when a command ("backtrace") is both a prefix and a regular command. It can paint us in a corner at some point. Let's say we want to introduce the syntax: (gdb) backtrace SYMBOL at some point, then the sub-command "shadow" would conflict if someone wanted to call the command "backtrace" with the symbol "shadow". >From what I read in the thread above, the downside of the "backtrace -shadow" option is that some other options wouldn't make sense for the shadow backtrace. I don't think it's a problem, those other options can just be ignored when printing the shadow stack. Simon