From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id cnifGXbvtGr7EjwAWB0awg (envelope-from ) for ; Thu, 24 Sep 2026 05:37:58 -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=a3JW1Dtc; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 22FA01E06B; Thu, 24 Sep 2026 05:37:58 -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 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 EDB551E033 for ; Thu, 24 Sep 2026 05:37:56 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5C89F4BB3BB7 for ; Thu, 24 Sep 2026 09:37:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C89F4BB3BB7 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=a3JW1Dtc Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 4CCA64BB24F9 for ; Thu, 24 Sep 2026 09:37:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4CCA64BB24F9 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 4CCA64BB24F9 Authentication-Results: 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=1790242652; cv=none; b=EjWSGR5PJmaBY/L6119hvJLhMX+CHxSEAnYsY/72jYnuVjv6Kq8FIMmU3zXpo1qrk3A1Q/JdEg5drK8+i/CF+3Jxud/MPpa6hdtSFKuCZj1ydw5C1nGWZyRd2TIIGQTKU/eww436/yUWTKvPcBGXzoBnFiYcwt8KFtEcnAl/Rhk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790242652; c=relaxed/simple; bh=QlMrXsjB/CCWGUvqnlLnXXi11ezTqYQZi/Vn4gTPZDg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=RIgFB/EDIzLy6VjtyoucjLGLombpvfmaRV4499Xc+uFLa1bgGtxhniPEyM+yRttxC+iH0lj16qKeyBBjai5HSa4kF33RgYhAKzsj8OAy2wxtGo+Qc7zARKtzgVl9R2cfKjsz+FdALFlJ4LCQ7c87H8mhAZ0bMen+X7VpZH1HfGo= ARC-Authentication-Results: i=1; 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=a3JW1Dtc DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CCA64BB24F9 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 1x9ftS-0003aC-LC; Thu, 24 Sep 2026 05:37:30 -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=/bPMbPugTRDhBCx9/4AxZyro8Kon+ydy5JNa+WRcEg4=; b=a3JW1DtcqX8b Nh8Hkj1wrbFskHBmH4nUh8iapl0sDU60laLlaluIugEcMvwhIi6VjGoq/I0TFuz3eRvn+zbJid6us Yf+R9DILrsTfOBI0lcVTUj2JS7zuqW1cvI6m/Jy0YfjrdJTTAhJ8c9070S+204ND/s1+HZaz6emtE ddDHiDXQ/hg3cR4IoOnvY262copP8VTKvENqcV/qdix+HUAswTioR6xy5Ww64PUE9+62Mw1yP/wIL 7cw4eT9o8nV/JNS9kqod1jgozsPfV4nQh4i5V8anEKAedrXWXFTd+GtZjgrfGVSic4P+Qn3IxNoi/ uMoEV9jCJgjuf3p8K7E0Uw==; Date: Thu, 24 Sep 2026 12:37:27 +0300 Message-Id: <86h5jf9ei0.fsf@gnu.org> From: Eli Zaretskii To: Christina Joos Cc: gdb-patches@sourceware.org, thiago.bauermann@linaro.org, tom@tromey.com, luis.machado.foss@gmail.com In-Reply-To: <20260924083311.1961530-9-christina.joos@intel.com> (message from Christina Joos on Thu, 24 Sep 2026 10:33:05 +0200) Subject: Re: [PATCH v5 08/13] gdb: Add command option 'bt -shadow' to print the shadow stack backtrace. References: <20260924083311.1961530-1-christina.joos@intel.com> <20260924083311.1961530-9-christina.joos@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 Joos > Cc: thiago.bauermann@linaro.org, tom@tromey.com, luis.machado.foss@gmail.com > Date: Thu, 24 Sep 2026 10:33:05 +0200 > > Add command option '-shadow" to the backtrace command to print the shadow > stack backtrace instead of the normal backtrace. > > This option may be combined with '-frame-info' and implies '-no-filters' > and '-frame-arguments none'. Also the options @samp{-past-entry} or > @samp{-hide} are not supported. > > This is an example for the output of 'bt -shadow' on amd64 linux: > ~~ > (gdb) bt -shadow > /#0 0x000055555555514a in call1 at amd64-shadow-stack.c:27 > /#1 0x000055555555515f in main at amd64-shadow-stack.c:38 > ~~ > > Note that the normal backtrace includes one additional frame, since > the shadow stack backtrace relies on return addresses of the shadow > stack only. But except the missing frame arguments and frame #0 of > the normal backtrace, the backtrace is the same. > ~~ > (gdb) bt > /#0 call2 () at amd64-shadow-stack.c:21 > /#1 0x000055555555514a in call1 () at amd64-shadow-stack.c:27 > /#2 0x000055555555515f in main () at amd64-shadow-stack.c:38 > ~~ > > This commit also adds a test for 'bt -shadow' on amd64. > Although the test is OS independent we can only test this on linux, > as GDB does not support shadow stack on other OS for now. > Also we do not add a test for 32 bit, as support for shadow stack is > limited to 64 bit by the linux kernel. > > Reviewed-by: Thiago Jung Bauermann > --- > gdb/NEWS | 3 + > gdb/doc/gdb.texinfo | 25 + > gdb/gdbarch-gen.h | 2 + > gdb/gdbarch.h | 1 + > gdb/gdbarch_components.py | 2 + > gdb/shadow-stack.c | 475 ++++++++++++++++++ > gdb/shadow-stack.h | 65 +++ > gdb/stack.c | 49 +- > gdb/stack.h | 43 ++ > .../gdb.arch/amd64-shadow-stack-cmds.exp | 47 ++ > gdb/testsuite/gdb.base/options.exp | 2 +- > 11 files changed, 689 insertions(+), 25 deletions(-) Thanks, the documentation parts are okay. Reviewed-By: Eli Zaretskii