From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10102 invoked by alias); 19 May 2005 01:23:10 -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 9960 invoked from network); 19 May 2005 01:22:56 -0000 Received: from unknown (HELO shearer.org) (210.10.97.33) by sourceware.org with SMTP; 19 May 2005 01:22:56 -0000 Received: from localhost ([127.0.0.1]:56580 helo=shearer.org) by shearer.org with esmtp (Dan's MTA 1.0) id 1DYZkV-0007UG-HL for gdb@sources.redhat.com; Thu, 19 May 2005 10:52:55 +0930 Received: from dan by erizo.shearer.org with local (Spammer Slammer 3.141) id 1DYZkU-0007UD-Lw for gdb@sources.redhat.com; Thu, 19 May 2005 10:52:54 +0930 Date: Thu, 19 May 2005 01:23:00 -0000 From: Dan Shearer To: gdb@sources.redhat.com Subject: Re: [discuss] Support for reverse-execution Message-ID: <20050519012254.GZ19642@erizo.shearer.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Organisation: shearer.org User-Agent: Mutt X-SW-Source: 2005-05/txt/msg00182.txt.bz2 Johan Rydberg, a developer at Virtutech, has got some patches against 6.3 (for discussion only) that he'll be sending along to this list. I want to bring up bookmarks for discussion, a topic that isn't yet addressed by his patches. First, what is addressed: Johan has implemented the reverse instructions rstep, rstepi, rnext and rnexti for PowerPC, Sparc and Sparc64 targets. Next to appear will be rcontinue (easy) and rfinish (not so easy), however all of these are obvious reversible analogues to the conventional commands. You should see these when Sweden wakes up next. Bookmarks are not about reversibility, they are about checkpointing. To understand bookmarks you first have to think about what a reversible target is. Any simulator (or real hardware for that matter) capable of reversibility has a mechanism to keep or re-generate all system state and the ability to restart execution from any point in that stored state. Bookmarking is a way of exposing this functionality to the user. Imagine two new gdb commands, get-bookmark and goto-bookmark. get-bookmark asks the simulator for a token which uniquely identifies the current state of the system. goto-bookmark gives a token back to the simulator and asks the simulator to load system state as it was at the time of the bookmark. The token is an arbitary number that makes sense to the particular simulator. Some might count in clock cycles, others in milliseconds or maybe the number of the checkpoint that corresponds to the state at that time. All gdb knows about is the value of the bookmark. This gives a gdb user the capability to explore alternative futures without a complicated interface. A sequence might be get-bookmark, change a value, run for ten seconds. Break, goto-bookmark, try another value and run for ten seconds. Like an infinite rewind-replay facility, very helpful when part of the pain is getting the circumstances just right for the bug to appear. It would be an interesting discussion to see how bookmarks could be incorporated into the gdb framework. -- Dan Shearer dan@shearer.org