From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by sourceware.org (Postfix) with ESMTPS id 50D633850B16 for ; Fri, 16 Dec 2022 13:25:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 50D633850B16 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f45.google.com with SMTP id a17so1323079wrt.11 for ; Fri, 16 Dec 2022 05:25:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qUpjlYjUZbcCFWlTL+tmBfKPrBTljoMbufLTPyoAH10=; b=hkbYPTotVT3N7HRMzjKZGuKUy4YUnVKTBeaS0PENSOg9v2W3ngOen1wN8Rt+KEgv3g 1aVcVRATSyLmqvvhqPgIJgcX00nkF0jIwICUwCnaELERcHPwVEk68cEe41Zne5cQQ7bs R0eV3F9tV0KyaU6JSRrpCNex9meRcZmejRhwd0Gs9WU4BN503oszD1PLCrJf2voXWOUw H0GNqwuHKUYQMpewd6mnq31BL6Gi2P+gCvIcvwg/dAX28g6uTZGejtMV6M6dgFHdFx1E 8E1u3pC4kbY4RhEKwrLiNEwXuu3LlOl9+Gq3/FxFzBpmLMZ+Bve5lWlTxh6tIQAMX+A0 bFUw== X-Gm-Message-State: ANoB5plui/MwlMIRdjnP2+UFACOS/uuQ4gQLwmJHb4Yhgye9HJg01pdX Gszk655NIynj6mDdR6L8n2tAZZd/gF+hlQ== X-Google-Smtp-Source: AA0mqf59FOSrMcoOIC8OnG+IapxQReP2mBcF32760zPwUEf7pXkT/L4Wv0zKFdJioGDecfY83VsYmQ== X-Received: by 2002:a5d:4a02:0:b0:24d:7420:436d with SMTP id m2-20020a5d4a02000000b0024d7420436dmr11091443wrq.51.1671197144644; Fri, 16 Dec 2022 05:25:44 -0800 (PST) Received: from ?IPv6:2001:8a0:f912:6700:afd9:8b6d:223f:6170? ([2001:8a0:f912:6700:afd9:8b6d:223f:6170]) by smtp.gmail.com with ESMTPSA id c16-20020adffb50000000b002365254ea42sm2343198wrs.1.2022.12.16.05.25.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 16 Dec 2022 05:25:44 -0800 (PST) Subject: Re: [PATCH v2] gdb: add 'maintenance print record-instruction' command To: Bruno Larsen , gdb-patches@sourceware.org References: <20221212104417.136536-1-blarsen@redhat.com> From: Pedro Alves Message-ID: Date: Fri, 16 Dec 2022 13:25:43 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20221212104417.136536-1-blarsen@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-12-12 10:44 a.m., Bruno Larsen via Gdb-patches wrote: > 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. Please include an example of this working in the commit log. > --- > gdb/NEWS | 6 ++++ > gdb/doc/gdb.texinfo | 8 +++++ > gdb/record-full.c | 81 +++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 95 insertions(+) > > diff --git a/gdb/NEWS b/gdb/NEWS > index c4ccfcc9e32..d6ce6bf86a0 100644 > --- 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. I noticed missing double space after period in the sentences above.