From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id B3886385C660 for ; Mon, 12 Dec 2022 13:54:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B3886385C660 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org 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 1p4jFx-0003Km-7c; Mon, 12 Dec 2022 08:54:09 -0500 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=W4kxZstXrMzrDakoiEAz081LmGDHR4tNGL5Xu4j5j1g=; b=XhWdrPcGExDK 1Fm+ryzFjptjTDEu7+IYj/vQUOIhxXmK1nw82199nQnml96Mxv/BmwfhhtH4fN3c08Sy6CVtHWgFC i1kK6GhWpxx0/UMe0DXkJ3DjCo4gJyxA6jrr0Unncyvf5uXpULv/zMXXy3uQwUTtevP41l8e6j2Vd t+Al1Tidbn5W+75xr3UvXh2lbbLXnK2m5R7khFO1btfgQv0RgK2iN6KhvvogQXb6Ci0aRF2BmvkX9 ecNwDTIOinezK4H9TIYZgLLcE3JpiBDUy04NFX6twr4U1bedBqpCiDDeDJMLVggeGlLC8MRGPN7di Su5ExB+zEw6XZou2pEb8sg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4jFw-0001Lv-G7; Mon, 12 Dec 2022 08:54:08 -0500 Date: Mon, 12 Dec 2022 15:54:10 +0200 Message-Id: <83a63ssp6l.fsf@gnu.org> From: Eli Zaretskii To: Bruno Larsen Cc: gdb-patches@sourceware.org In-Reply-To: <20221212104417.136536-1-blarsen@redhat.com> (message from Bruno Larsen via Gdb-patches on Mon, 12 Dec 2022 11:44:17 +0100) Subject: Re: [PATCH v2] gdb: add 'maintenance print record-instruction' command References: <20221212104417.136536-1-blarsen@redhat.com> X-Spam-Status: No, score=1.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Cc: Bruno Larsen > Date: Mon, 12 Dec 2022 11:44:17 +0100 > From: Bruno Larsen via Gdb-patches > > While chasing some reverse debugging bugs, I found myself wondering what > was recorded by GDB to undo and redo a certain instruction. This commit > implements a simple way of printing that information. > --- > gdb/NEWS | 6 ++++ > gdb/doc/gdb.texinfo | 8 +++++ > gdb/record-full.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 95 insertions(+) Thanks. > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -103,6 +103,12 @@ > > * New commands > > +maintenance print record-instruction [ N ] > + Print the recorded information for a given instruction. If N is not given > + prints how GDB would undo the last instruction executed. If N is negative, > + prints how GDB would undo the N-th previous instruction, and if N is > + positive, it prints how GDB will redo the N-th following instruction. This part is OK. > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -40531,6 +40531,14 @@ that symbol is described. The type chain produced by this command is > a recursive definition of the data type as stored in @value{GDBN}'s > data structures, including its flags and contained types. > > +@kindex maint print record-instruction > +@item maint print record-instruction > +@itemx maint print record-instruction @var{N} > +@cindex print how GDB recorded a given instruction. If N is not positive ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Some editing snafu happened here, it seems? > +number, it prints the values stored by the inferior before the N-th previous > +instruction was exectued. If N is positive, print the values after the N-th > +following instruction is executed. If N is not given, 0 is assumed. In all places where you use "M" (upper-case), you should use "@var{n}" (with @var and in lower-case). The gdb.texinfo part is OK with those nits fixed.