From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12698 invoked by alias); 24 Dec 2009 14:08:45 -0000 Received: (qmail 12688 invoked by uid 22791); 24 Dec 2009 14:08:44 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from smarthost03.mail.zen.net.uk (HELO smarthost03.mail.zen.net.uk) (212.23.3.142) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Dec 2009 14:08:36 +0000 Received: from [86.145.139.15] (helo=[192.168.2.3]) by smarthost03.mail.zen.net.uk with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1NNoMi-0003mk-9s; Thu, 24 Dec 2009 14:08:32 +0000 Message-ID: <4B3370A2.8000701@undo-software.com> Date: Thu, 24 Dec 2009 14:08:00 -0000 From: Greg Law User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 To: Michael Snyder CC: Julian Smith , "gdb@sources.redhat.com" Subject: Re: reverse-next doing repeated reverse-stepi's ? References: <20091223170048.88d90ba6.jsmith@undo-software.com> <4B325D82.4010102@vmware.com> In-Reply-To: <4B325D82.4010102@vmware.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Originating-Smarthost03-IP: [86.145.139.15] 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-12/txt/msg00148.txt.bz2 Michael Snyder wrote: > Julian Smith wrote: >> I've been trying out reverse-next with UndoDB as a remote debug server, >> and it looks like reverse-next works by doing repeated >> `bs' (reverse-stepi) commands. >> >> I was expecting it to set breakpoints and do `bc' (reverse-continue) >> commands, by analogy with normal forwards step etc. >> >> Am i doing something wrong here ? Or is this the expected behaviour ? > > Short answer: this is expected behavior. > > Forward-next works the same way, in general. > Both forward-next and reverse-next will set breakpoints > under some circumstances, but will often work by > singlestepping. If I understand correctly, when doing a 'next' gdb does something like: while (PC in current line) { ptrace (PTRACE_SINGLESTEP) if (PC outside current function) { plant breakpoint at return address ptrace (PTRACE_CONT) remove breakpoint } } however, when doing a reverse-next, we don't see this. We just see repeated reverse single-steps. If trying to do a reverse-next over a non-trivial function, this can take a very long time. Is this expected? Greg -- Greg Law, Undo Software http://undo-software.com/