From patchwork Wed Apr 10 04:19:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Eggert X-Patchwork-Id: 32242 Received: (qmail 10369 invoked by alias); 10 Apr 2019 04:19:25 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 10298 invoked by uid 89); 10 Apr 2019 04:19:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=recording, replay, Replay, tracked X-HELO: zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu (HELO zimbra.cs.ucla.edu) (131.179.128.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Apr 2019 04:19:23 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3DB221615EA for ; Tue, 9 Apr 2019 21:19:22 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id Jspot47BCaXJ for ; Tue, 9 Apr 2019 21:19:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 2BFC01615FF for ; Tue, 9 Apr 2019 21:19:21 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 5Uus1OzuRSZd for ; Tue, 9 Apr 2019 21:19:21 -0700 (PDT) Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 09213161589 for ; Tue, 9 Apr 2019 21:19:21 -0700 (PDT) To: gdb-patches@sourceware.org From: Paul Eggert Subject: reverse execution part of the manual is written backwards Message-ID: <5fbd40b5-7887-1000-3457-75190a5d96c0@cs.ucla.edu> Date: Tue, 9 Apr 2019 21:19:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 [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. @kindex reverse-continue 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. @table @code