[Converted from Gnats 1962] Linux 2.6.11-1.1369_FC4 #1 athlon Release: GNU gdb Red Hat Linux (6.3.0.0-1.21rh) How-To-Repeat: struct B; struct A { static B b; }; struct B { A a; }; B A::b; B b; int main(int,char **) { // set a breakpoint here, run, then print b // Results in infinite recursion }
From: Ramana Radhakrishnan <ramana.radhakrishnan@codito.com> To: gdb-prs@sources.redhat.com, vcato@bellsouth.net, nobody@sources.redhat.com, gdb-gnats@sources.redhat.com Cc: Subject: Re: c++/1962: Nested static causing infinite recursion in print. Date: Fri, 04 Nov 2005 01:04:32 +0530 http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gdb&pr=1962 Verified . This exists on gdb 6.3 ubuntu using g++-3.4 . Haven't tried it with a later version . Also exists on the gdb 6.4 release branch as of GNU gdb 6.3.90-20051103-cvs cheers Ramana -- Ramana Radhakrishnan GNU Tools codito ergo sum (www.codito.com)
Subject: Bug 9067 CVSROOT: /cvs/src Module name: src Changes by: cmoller@sourceware.org 2010-02-08 18:04:17 Modified files: gdb : ChangeLog cp-valprint.c gdb/testsuite : ChangeLog gdb/testsuite/gdb.cp: Makefile.in Added files: gdb/testsuite/gdb.cp: pr9067.cc pr9067.exp Log message: PR gdb/9067 * cp-valprint.c (cp_print_value_fields) Fix use of obstacks. cp_print_static_field) Fix use of obstacks. * gdb.cp/pr9067.exp: New * gdb.cp/pr9067.cc: New * gdb.cp/Makefile.in (EXECUTABLES): Add pr9067 Patches: http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/ChangeLog.diff?cvsroot=src&r1=1.11333&r2=1.11334 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/cp-valprint.c.diff?cvsroot=src&r1=1.63&r2=1.64 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2124&r2=1.2125 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/pr9067.cc.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/pr9067.exp.diff?cvsroot=src&r1=NONE&r2=1.1 http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gdb/testsuite/gdb.cp/Makefile.in.diff?cvsroot=src&r1=1.7&r2=1.8
Fixed by the patch shown below.