From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29114 invoked by alias); 21 May 2005 15:53:50 -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 29080 invoked from network); 21 May 2005 15:53:47 -0000 Received: from unknown (HELO sccrmhc14.comcast.net) (204.127.202.59) by sourceware.org with SMTP; 21 May 2005 15:53:47 -0000 Received: from [10.0.1.2] (c-24-61-199-96.hsd1.nh.comcast.net[24.61.199.96]) by comcast.net (sccrmhc14) with SMTP id <2005052115534601400jj2d3e>; Sat, 21 May 2005 15:53:46 +0000 User-Agent: Microsoft-Entourage/11.1.0.040913 Date: Sat, 21 May 2005 15:53:00 -0000 Subject: Re: [discuss] Support for reverse-execution From: Paul Schlie To: Russell Shaw , Message-ID: Mime-version: 1.0 Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit X-SW-Source: 2005-05/txt/msg00270.txt.bz2 > Russell Shaw writes: > Yes, that's what i meant (every step). It could be configureable so > that the policy can be set to every user-stop, every function call, > or disabled alltogether. The idea is that you could run from main() > until a segfault happens, then "back 10" and step thru the last few > actions. There's nothing inherently wrong with the strategy, as long as one understands that the utility it provides can be deceptive; for example given the following simple program fragment: void foo(void) { x = the_real_problem(); for (int i = x, i != 0, ++i) { something(); } } foo(); // step from here. ... ; // to here. It's clear that tracing and recording the last N states can easily be consumed in uninteresting code. A similar strategy may constrain the N full state traces/snapshots to only entries into basic blocks, which both allows N to be smaller, while simultaneously enabling a broader swipe of interesting locations to recorded for subsequent inspection. This ideally either requires that the compiled program be analyzed to apriority identify these entry points, although a close approximation may be determined at runtime by only recording state traces at points of control flow change; i.e. capture and record state only upon a given condition, (typically when the PC != PC + 1, for example), or may be generalized to any arbitrary set of "watch-point" conditions; as an incremental nicety, not unlike the HW trace history buffer support that some processors provide. (and could be enabled by GDB directly, with or without target support)