From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27080 invoked by alias); 20 Mar 2009 01:18:36 -0000 Received: (qmail 27072 invoked by uid 22791); 20 Mar 2009 01:18:36 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12,J_CHICKENPOX_93,SPF_PASS,WEIRD_PORT X-Spam-Check-By: sourceware.org Received: from imr1.ericy.com (HELO imr1.ericy.com) (198.24.6.9) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 20 Mar 2009 01:18:30 +0000 Received: from eusrcmw750.eamcs.ericsson.se (eusrcmw750.exu.ericsson.se [138.85.77.50]) by imr1.ericy.com (8.13.1/8.13.1) with ESMTP id n2K1QNnO007585 for ; Thu, 19 Mar 2009 20:26:23 -0500 Received: from ecamlmw720.eamcs.ericsson.se ([142.133.1.72]) by eusrcmw750.eamcs.ericsson.se with Microsoft SMTPSVC(6.0.3790.1830); Thu, 19 Mar 2009 20:18:27 -0500 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: ProcessRecord problem with recursion Date: Fri, 20 Mar 2009 01:18:00 -0000 Message-ID: <6D19CA8D71C89C43A057926FE0D4ADAA07152198@ecamlmw720.eamcs.ericsson.se> From: "Marc Khouzam" To: 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-03/txt/msg00127.txt.bz2 Hi, I'm having problems with ProcessRecord and recursion. It looks like the reverse-next operation behaves like reverse-step when dealing with a recursive method. I have GDB HEAD from the 18th of March, with the patches included in http://sourceware.org/ml/gdb-patches/2009-03/msg00375.html http://sourceware.org/ml/gdb-patches/2009-03/msg00005.html http://sourceware.org/ml/gdb-patches/2009-01/msg00444.html Here is a program and session that shows the problem: GNU gdb (GDB) 6.8.50.20090318-cvs [...] (gdb) l 1 int factorial(int x) { 2 if (x =3D=3D 1) return 1; 3 int result =3D x * factorial(x-1); 4 return result; 5 } 6 7 int main() { 8 factorial(5); 9 return 0; 10 } (gdb) start Temporary breakpoint 1 at 0x804847b: file a.cc, line 8. Starting program: /local/home/lmckhou/testing/a.out=20 Temporary breakpoint 1, main () at a.cc:8 8 factorial(5); (gdb) rec (gdb) s factorial (x=3D5) at a.cc:2 2 if (x =3D=3D 1) return 1; (gdb) n 3 int result =3D x * factorial(x-1); (gdb) n 4 return result; (gdb) rn factorial (x=3D4) at a.cc:5 5 } Notice how the reverse-next(rn) command jumped to the end of the next factorial method on the stack (x=3D4 instead of x=3D5). Thanks Marc