From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17906 invoked by alias); 20 May 2005 13:18:53 -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 17848 invoked from network); 20 May 2005 13:18:44 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 20 May 2005 13:18:44 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DZ7Oj-0006qf-CV; Fri, 20 May 2005 09:18:41 -0400 Date: Fri, 20 May 2005 13:18:00 -0000 From: Daniel Jacobowitz To: Andreas Schwab Cc: Eli Zaretskii , Johan Rydberg , dan@shearer.org, gdb@sources.redhat.com Subject: Re: [discuss] Support for reverse-execution Message-ID: <20050520131841.GC25206@nevyn.them.org> Mail-Followup-To: Andreas Schwab , Eli Zaretskii , Johan Rydberg , dan@shearer.org, gdb@sources.redhat.com References: <20050519012254.GZ19642@erizo.shearer.org> <428C8E04.3000305@virtutech.com> <01c55d27$Blat.v2.4$69471120@zahav.net.il> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-SW-Source: 2005-05/txt/msg00211.txt.bz2 On Fri, May 20, 2005 at 01:37:48PM +0200, Andreas Schwab wrote: > The beginning or any part of the source line? While the latter is easy to > determine (just step until the source line changes), the former is not > very well defined, since the code for a source line can be intermixed with > code from other source lines. On the other hand, just stepping until the > source line changes is not very useful, since in extreme case you'll just > step back a single insn if the previous command was a forward step and you > won't really undo much of this step. I suspect that the best we can do is back to the beginning of the previous fragment of a source line; step backwards until your PC matches the start of an entry in the line table. We need a coherent story for presenting fragmented lines to the user, but we don't have one - in either direction. That'll be as good as what we do going forwards. Of course it's possible that you enter the previous line in the middle: = line 1 label: line 1 some more line 1 a bit more = PC: line 2 line 2 I think the way to do this is to take advantage of the fact that reversible targets are generally (always? too early to tell perhaps) going to be repeatable. We can single-step backwards once, enter line 1, single step backwards again, still in line 1, single-step backwards again, we've gone too far, single-step forwards. Or, we could use a temporary bookmark. Single-step backwards once, enter line 1, place bookmark, single-step backwards again, good, update bookmark. Again, oops we're somewhere else, jump to bookmark and report a stop at label. Or implement both in case some target supports reverse execution without bookmarks. -- Daniel Jacobowitz CodeSourcery, LLC