From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28711 invoked by alias); 20 May 2005 21:27:33 -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 28687 invoked from network); 20 May 2005 21:27:28 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 20 May 2005 21:27:28 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DZF1j-0002WL-LT; Fri, 20 May 2005 17:27:27 -0400 Date: Fri, 20 May 2005 21:27:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb@sources.redhat.com, Eli Zaretskii Subject: Re: [discuss] Support for reverse-execution Message-ID: <20050520212726.GN4861@nevyn.them.org> References: <428E527D.70402@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <428E527D.70402@redhat.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00240.txt.bz2 [Michael, if you get a chance, please update your address book; I'm not @mvista.com any more.] On Fri, May 20, 2005 at 02:11:25PM -0700, Michael Snyder wrote: > 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: After reading this a couple of times, I'm pretty sure you're right. Consider: line: foo line2: inc $r1 cmp $r1, 64 bne line line3: bar # $pc points here Reverse stepi from the inc may go to the bne, but we want to stop when reverse stepi from the inc would go to the foo instead. We don't have a lot of opportunity to make sure we're really where we want to be when we're going forwards. When we're going backwards, though, we do. Let's use it! > (gdb) reverse-step > # reverse-stepi once (or until we leave the *current* line) BTW, this bit is a little more complicated, because we might go to another frame. So we might have to do some reverse-finish's stacked in there. I think infrun will need some serious cleaning up to pull this off. > # 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. -- Daniel Jacobowitz CodeSourcery, LLC