From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +VmSIXeK0mgANA8AWB0awg (envelope-from ) for ; Tue, 23 Sep 2025 07:54:31 -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=KGnnhPfM; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 65ABD1E0BA; Tue, 23 Sep 2025 07:54:31 -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 B072B1E047 for ; Tue, 23 Sep 2025 07:54:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 491FA3858416 for ; Tue, 23 Sep 2025 11:54:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 491FA3858416 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=KGnnhPfM Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 9E3EA3858D29 for ; Tue, 23 Sep 2025 11:53:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9E3EA3858D29 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 9E3EA3858D29 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=1758628437; cv=none; b=P9U3T2X/6ajUKaG7XR+ykmcmyvi8EQDHSAwLYcIMGDbaYdkunaHhHj16gLwqbaqPv1PL93HsF8o/tHYcGdMiNQiPpDDDdgyR+wOzDbL+iWHv+LsVsANnfPjl1DJzeud0rVFFmo+tpFyIwMGZnq4vZQdATADxs9TsSofr7rXFpVI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1758628437; c=relaxed/simple; bh=NaNG9qSezvBuQcRn3QLzW63ii5FZbtJPA9ikbaK4Wuo=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=dQYNprBvjgWrKS85Dcu6btbtuWaX8Fg47FXWTCbfZF6lTsNFPL0Jfk2Mblkt07NhumBIQxpvby1arlEh64Yu65SNPqIKmC50yxMMOtKv+VVO0KvK4+z/I/VqdnYAQkTsax7Fs4m+mVzucog6zKh2pCHC0EOJ3VspsOy10BUHgd0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9E3EA3858D29 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 1v11ak-0002M6-7Z; Tue, 23 Sep 2025 07:53:54 -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=hE9GmuzqolYzy15deQ81IovfyPo2e+uCxJk54zAXyko=; b=KGnnhPfM4lDH o1LW3Y6ybeSzrWuOvaEkxD5hIdYpz0MNsPPZ32EXam/AzmdcJx4Ms7D3Zsp8DD2/EoTltxynr2S2g eGFmoy0j807xF6V446W2KeyTYtXdzbWZr3H294Xt8vn+AmZMjaugPWnRRIAVvDSNJviJMQzthJNDa IP2NSmMY3MaESM18X+E4B269IYt7L3vrPNCz+5rBzcfPnKrsYsHjkCMooWVHTK1DPVZT/ocEiD2pj 4o1of0jvY6XDWevuvHauf2PP3QMY2TNlbZX3beIWhgNZrOQLkninMDgzWZ1Jc8RGfVqVrUVv/UZEM zxWeds8a7OedbnJGCShyjg==; Date: Tue, 23 Sep 2025 14:53:49 +0300 Message-Id: <86v7l9crle.fsf@gnu.org> From: Eli Zaretskii To: Christina Schimpe Cc: gdb-patches@sourceware.org In-Reply-To: <20250923111842.4091694-10-christina.schimpe@intel.com> (message from Christina Schimpe on Tue, 23 Sep 2025 11:18:42 +0000) Subject: Re: [PATCH 9/9] gdb, mi: Add -shadow-stack-list-frames command References: <20250923111842.4091694-1-christina.schimpe@intel.com> <20250923111842.4091694-10-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:42 +0000 > > Add the mi command for the subcommand "backtrace shadow". > Similar to the mi interface for the ordinary backtrace command, > support low-frame and high-frame as command line parameters. > > Example print of a full shadow stack backtrace: > ~~~ > (gdb) > -shadow-stack-list-frames > ^done,shadow-stack=[ > shadow-stack-frame={level="0",addr="0x00007ffff7c3fe70", > func="__libc_start_call_main",file="../sysdeps/nptl/libc_start_call_main.h", > fullname="/usr/[...]/sysdeps/nptl/libc_start_call_main.h", > line="58",arch="i386:x86-64"}, > shadow-stack-frame={level="1",addr="0x00007ffff7c3ff20", > func="__libc_start_main_impl",file="../csu/libc-start.c", > fullname="/usr/[...]/csu/libc-start.c", > line="128",arch="i386:x86-64"}, > shadow-stack-frame={level="2",addr="0x0000000000401075", > func="_start",arch="i386:x86-64"}] > ~~~ > > Example print of a shadow stack backtrace using low- and high-frame: > ~~~ > (gdb) > -shadow-stack-list-frames 0 1 > ^done,shadow-stack=[ > shadow-stack-frame={level="0",addr="0x00007ffff7c3fe70", > func="__libc_start_call_main",file="../sysdeps/nptl/libc_start_call_main.h", > fullname="/usr/[...]/sysdeps/nptl/libc_start_call_main.h", > line="58",arch="i386:x86-64"}, > shadow-stack-frame={level="1",addr="0x00007ffff7c3ff20", > func="__libc_start_main_impl",file="../csu/libc-start.c", > fullname="/usr/[...]/csu/libc-start.c", > line="128",arch="i386:x86-64"}] > ~~~ > --- > gdb/NEWS | 10 ++ > gdb/doc/gdb.texinfo | 47 ++++++ > gdb/mi/mi-cmd-stack.c | 146 ++++++++++++++++++ > gdb/mi/mi-cmds.c | 2 + > gdb/mi/mi-cmds.h | 1 + > gdb/shadow-stack.c | 17 +- > gdb/shadow-stack.h | 11 ++ > .../gdb.mi/mi-shadow-stack-signal.exp | 69 +++++++++ > gdb/testsuite/gdb.mi/mi-shadow-stack.exp | 65 ++++++++ > 9 files changed, 365 insertions(+), 3 deletions(-) > create mode 100644 gdb/testsuite/gdb.mi/mi-shadow-stack-signal.exp > create mode 100644 gdb/testsuite/gdb.mi/mi-shadow-stack.exp Thanks. > diff --git a/gdb/NEWS b/gdb/NEWS > index eb96ff2ae08..3c52f88b71d 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -40,6 +40,16 @@ 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. > > +* New MI commands > + > +-shadow-stack-list-frames > + > + Added new MI command '-shadow-stack-list-frames' which is equivalent to > + the CLI subcommand 'backtrace shadow' but supports 'low-frame' and > + 'high-frame' as command line parameters. The parameters are used to > + print shadow stack frames between certain levels on the shadow stack > + only. So we will support in MI features that are not supported by the CLI? Is that limitation really necessary? Reviewed-By: Eli Zaretskii