From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5839 invoked by alias); 24 Sep 2005 00:07:09 -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 5069 invoked by uid 22791); 24 Sep 2005 00:06:58 -0000 Received: from mail-out3.apple.com (HELO mail-out3.apple.com) (17.254.13.22) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 24 Sep 2005 00:06:58 +0000 Received: from relay6.apple.com (a17-128-113-36.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id j8O06sCR019527; Fri, 23 Sep 2005 17:06:54 -0700 (PDT) Received: from [17.219.207.38] (unknown [17.219.207.38]) by relay6.apple.com (Apple SCV relay) with ESMTP id E6ECD4C4; Fri, 23 Sep 2005 17:06:53 -0700 (PDT) Message-ID: <4334989E.3070107@apple.com> Date: Sat, 24 Sep 2005 00:07:00 -0000 From: Stan Shebs User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.12) Gecko/20050915 MIME-Version: 1.0 To: Michael Snyder Cc: gdb@sources.redhat.com Subject: Re: Using reverse execution References: <43309700.6010507@cisco.com> In-Reply-To: <43309700.6010507@cisco.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2005-09/txt/msg00176.txt.bz2 Michael Snyder wrote: > > Think about forward execution. Does gdb know anything > about system calls? In general, not. Does it know anything > about I/O? Definitely not, except in some special cases. > GDB knows about step, continue, and why-did-we-stop? > Those are its primatives. I think we know these primitives work for forward execution because we have 40+ years of experience that says they are useful. Students learn those in school as part of their formative experience with debugging, so there is also a bit of tautology - "these are useful for debugging because these are what we use for debugging". It's so ingrained that researchers in algorithmic and specification-based debugging continually have a hard time getting anybody interested in their approach. > > The target, on the other hand, may have lots of > capabilities, and it may not. Maybe it can only > "back up" until the first system call, and then > it gives up. This comes back to the "first impression" issue. App writers on Mac OS X have a huge numbers of libraries (frameworks) that they're suppposed to use, and at the bottom of those there are lots and lots of system calls going on. If the reverse step button is perpetually grayed out for every line more complicated than "a = b + c", users are going to see reversing as a useless feature and never get in the habit of using it to solve their problems. Fortunately I don't think we have to give up that easily; an adroitly designed mechanism could treat system call behavior as a black box requiring a bit of footwork to reverse past, just as GDB does some footwork with breakpoints to cover up how we're scribbling trap instructions all over supposedly read-only memory. :-) Stan