Bug 9067 - Nested static causing infinite recursion in print.
Summary: Nested static causing infinite recursion in print.
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.0
: P3 enhancement
Target Milestone: ---
Assignee: Chris Moller
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-02 17:18 UTC by vcato
Modified: 2010-02-08 18:54 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vcato 2005-07-02 17:18:01 UTC
[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
}
Comment 1 Ramana Radhakrishnan 2005-11-03 19:34:32 UTC
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)
Comment 2 Sourceware Commits 2010-02-08 18:04:40 UTC
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

Comment 3 Chris Moller 2010-02-08 18:54:45 UTC
Fixed by the patch shown below.