From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20563 invoked by alias); 9 Mar 2014 11:45:18 -0000 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org Received: (qmail 20522 invoked by uid 48); 9 Mar 2014 11:45:16 -0000 From: "vicshen at gmail dot com" To: gdb-prs@sourceware.org Subject: [Bug gdb/16678] New: record problem with recursion Date: Sun, 09 Mar 2014 11:45:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: 7.7 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: vicshen at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-q1/txt/msg00336.txt.bz2 https://sourceware.org/bugzilla/show_bug.cgi?id=16678 Bug ID: 16678 Summary: record problem with recursion Product: gdb Version: 7.7 Status: NEW Severity: normal Priority: P2 Component: gdb Assignee: unassigned at sourceware dot org Reporter: vicshen at gmail dot com 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. GNU gdb (GDB) 7.7 (gdb) l 1 int factorial(int x) { 2 if (x == 1) return 1; 3 int result = 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 0x4004a9: file a.c, line 8. Starting program: /home/jianshen/1/a Temporary breakpoint 1, main () at a.c:8 8 factorial(5); (gdb) record (gdb) n 9 return 0; (gdb) rn factorial (x=2) at a.c:3 3 int result = x * factorial(x-1); (gdb) bt #0 factorial (x=2) at a.c:3 #1 0x0000000000400499 in factorial (x=3) at a.c:3 #2 0x0000000000400499 in factorial (x=4) at a.c:3 #3 0x0000000000400499 in factorial (x=5) at a.c:3 #4 0x00000000004004b3 in main () at a.c:8 rn should return to line 8 but it jumps to line 3 in another frame. I searched and found Hui Zhu has once provided a patch for this issue. See https://sourceware.org/ml/gdb/2009-03/msg00134.html But in the latest version (7.7) it's still could be reproduced. It might be a missing bug. -- You are receiving this mail because: You are on the CC list for the bug.