From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27298 invoked by alias); 21 Aug 2009 10:57:44 -0000 Received: (qmail 27281 invoked by uid 22791); 21 Aug 2009 10:57:43 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from oden.vtab.com (HELO oden.vtab.com) (62.20.90.195) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 21 Aug 2009 10:57:34 +0000 Received: from oden.vtab.com (oden.vtab.com [127.0.0.1]) by oden.vtab.com (Postfix) with ESMTP id BAE5C26EEFD; Fri, 21 Aug 2009 12:57:29 +0200 (CEST) Received: from polhem (unknown [62.20.90.206]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by oden.vtab.com (Postfix) with ESMTP id 93FD426EEBD; Fri, 21 Aug 2009 12:57:29 +0200 (CEST) From: "Jakob Engblom" To: "'Julian Smith'" , References: <20090811224401.4d9e8942.jsmith@undo-software.com> <4A81FD36.2040009@vmware.com> <20090821084807.5e296baf.jsmith@undo-software.com> In-Reply-To: <20090821084807.5e296baf.jsmith@undo-software.com> Subject: RE: Some questions about gdb's remote protocol and reverse debugging Date: Fri, 21 Aug 2009 15:43:00 -0000 Message-ID: <003601ca224e$2fef0ef0$8fcd2cd0$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-08/txt/msg00206.txt.bz2 > Ok. > > But... isn't there always going to be a difference when going > backwards, e.g. if an instruction jumps to an address in a register, > one cannot know about this jump when stepping backwards (and so, for > example, one cannot first go back to the destination of the jump, do a > `bs' to step back over the jump, then carry on with `bc')? Perhaps this > sort of indirect jump never occurs within a function though, so is not a > problem for things like reverse-step. > > Anyway, many thanks for you help, 'tis much appreciated. I'm still > tinkering with things, but i think i should be able to make progress > now. Note that you are not executing backwards: you are inspecting what happened. You do not reverse individual instructions, you are looking at a history. In this case, of course you can go back forth across jumps, interrupts, returns, and any other change of location. How to implement it varies, but either you reexecute deterministically but one step shorter, or you look into some recorded execution trace and just move one step back in that. /jakob