From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12028 invoked by alias); 20 May 2005 21:11:44 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 11875 invoked from network); 20 May 2005 21:11:35 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sourceware.org with SMTP; 20 May 2005 21:11:35 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.12.11/8.12.11) with ESMTP id j4KLBYmp004637 for ; Fri, 20 May 2005 17:11:34 -0400 Received: from potter.sfbay.redhat.com (potter.sfbay.redhat.com [172.16.27.15]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id j4KLBTO11940; Fri, 20 May 2005 17:11:29 -0400 Received: from [172.16.24.50] (bluegiant.sfbay.redhat.com [172.16.24.50]) by potter.sfbay.redhat.com (8.12.8/8.12.8) with ESMTP id j4KLBQa8010300; Fri, 20 May 2005 17:11:26 -0400 Message-ID: <428E527D.70402@redhat.com> Date: Fri, 20 May 2005 21:11:00 -0000 From: Michael Snyder User-Agent: Mozilla Thunderbird (X11/20050322) MIME-Version: 1.0 To: gdb@sources.redhat.com, Eli Zaretskii , Daniel Jacobowitz Subject: Re: [discuss] Support for reverse-execution Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg00237.txt.bz2 In regards to the question "where does a reverse-step put you?" (ie. at the beginning of a line, or somewhere in the line): > Sorry, I'm confused. Isn't it right that if I'm stepping > backwards through code such as this: > > i += 1; > foo (i); > =>i = 0; > > where "=>" shows the current source line, then typing `rnext' > once will get me to this: > > i += 1; > =>foo (i); > i = 0; > > which means I'm now before the CALL insn that calls `foo'? I agree with this interpretation. If I am a user (and I am), and I were to say: (gdb) step (gdb) reverse-step (or whatever) I would expect to be back where I started, ie. at the *beginning* of the original line. Dan J. has said that we might need to reverse-stepi until we've gone back one too many, and then do a forward step. I agree. In fact, I think it will be necessary to do the following: (gdb) reverse-step # reverse-stepi once (or until we leave the *current* line) # now establish the step-range start and end (prev line) # reverse-stepi until we leave the prev line # stepi once to get back to the desired line.