From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20753 invoked by alias); 13 Sep 2005 22:01:35 -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 20710 invoked by uid 22791); 13 Sep 2005 22:01:30 -0000 Received: from nat-pool-rdu.redhat.com (HELO devserv.devel.redhat.com) (66.187.233.202) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 13 Sep 2005 22:01:30 +0000 Received: from alligator.red-bean.com.redhat.com (vpn26-4.sfbay.redhat.com [172.16.26.4]) by devserv.devel.redhat.com (8.12.11/8.12.11) with ESMTP id j8DM1Rch031164; Tue, 13 Sep 2005 18:01:27 -0400 To: "Min Xu (Hsu)" Cc: Stan Shebs , gdb@sources.redhat.com Subject: Re: Using reverse execution References: <432628AA.2040808@apple.com> <20050913181057.GH5161@cs.wisc.edu> From: Jim Blandy Date: Tue, 13 Sep 2005 22:01:00 -0000 In-Reply-To: <20050913181057.GH5161@cs.wisc.edu> (Min Xu's message of "Tue, 13 Sep 2005 13:11:05 -0500") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-09/txt/msg00090.txt.bz2 ptrace allows you to stop the program just before and after it makes a system call; this allows programs like strace to recover the parameters that were passed, and the values returned. It's also enough control to allow you to "replay" the system calls with values you've saved earlier. Michael Chastain has written a program to do this. The system call record would have to be related in the appropriate way to whatever bookmarks or checkpoints the system retained. Some obvious restrictions: - if you rewind and then modify the inferior's state, it may not make the same system calls it did before. The illusion can't be sustained, and you just have to punt somehow. - Getting signals like SIGIO or SIGWINCH to arrive at exactly the same points is something I just don't know how to do. It's clear how to take and restore snapshots, but it's not clear how to recognize when a system has re-reached a given state and should have its signal re-delivered. But it still seems like enough to be helpful in a lot of cases.