From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 55858 invoked by alias); 10 Apr 2019 11:51:41 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 55849 invoked by uid 89); 10 Apr 2019 11:51:41 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=tracked X-HELO: mail-wm1-f42.google.com Received: from mail-wm1-f42.google.com (HELO mail-wm1-f42.google.com) (209.85.128.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Apr 2019 11:51:40 +0000 Received: by mail-wm1-f42.google.com with SMTP id z24so2258067wmi.5 for ; Wed, 10 Apr 2019 04:51:39 -0700 (PDT) Return-Path: Received: from ?IPv6:2001:8a0:f913:f700:56ee:75ff:fe8d:232b? ([2001:8a0:f913:f700:56ee:75ff:fe8d:232b]) by smtp.gmail.com with ESMTPSA id y9sm62679327wrn.18.2019.04.10.04.51.37 (version=TLS1_3 cipher=AEAD-AES128-GCM-SHA256 bits=128/128); Wed, 10 Apr 2019 04:51:37 -0700 (PDT) Subject: Re: reverse execution part of the manual is written backwards To: Paul Eggert , gdb-patches@sourceware.org References: <5fbd40b5-7887-1000-3457-75190a5d96c0@cs.ucla.edu> From: Pedro Alves Message-ID: <51cb91ba-6bcd-3de9-43d4-c766e2737c88@redhat.com> Date: Wed, 10 Apr 2019 11:51:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <5fbd40b5-7887-1000-3457-75190a5d96c0@cs.ucla.edu> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-SW-Source: 2019-04/txt/msg00179.txt.bz2 On 4/10/19 5:19 AM, Paul Eggert wrote: > [resent from https://sourceware.org/bugzilla/show_bug.cgi?id=24417] > > At least two Emacs developers were confused by GDB's documentation for reverse execution. One said he could never get it to work and recommended another debugger instead since it always worked for him. We tracked down the issue to a problem in GDB's documentation: it documents how to do reverse execution, but never mentions until a later section that you can't use reverse execution unless you first turn on process recording. > > Surely it's not intended that one must read the GDB documentation backwards in order to know how to do reverse execution.... > > Proposed patch follows. This is just a minor doc patch so I assume no ChangeLog entry is needed. > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index f410d026b8..147c7c0f37 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -6697,8 +6697,11 @@ assumes that the memory and registers that the target reports are in a >  consistant state, but @value{GDBN} accepts whatever it is given. >  }. > > -If you are debugging in a target environment that supports > -reverse execution, @value{GDBN} provides the following commands. > +Before using reverse execution, you should first use the @code{record} > +command, so that instructions executed by the program are saved for > +reverse execution later.  @xref{Process Record and Replay}. > +@value{GDBN} provides the following commands to examine the process > +record and execute the program in reverse. This is not correct. "record" is one way to support reverse execution, but there are others. For example, "record" is an alias for "record full". "record btrace" also supports reverse debugging. And then there are remote targets that suppose reverse debugging natively, like system emulators, and you won't type "record" with those at all. Mozilla's RR is another example. https://www.gnu.org/software/gdb/news/reversible.html > >  @table @code >  @kindex reverse-continue Thanks, Pedro Alves