This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PR10687 Printing c++ class with static array (of same type) can produce infinite output
- From: Tom Tromey <tromey at redhat dot com>
- To: Chris Moller <cmoller at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 20 Apr 2010 12:27:49 -0600
- Subject: Re: PR10687 Printing c++ class with static array (of same type) can produce infinite output
- References: <4BC524E8.404@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "Chris" == Chris Moller <cmoller@redhat.com> writes:
Chris> Added yet another recursion detector (the third, so far as I noticed)
Chris> to cp-valprint.c. This one detects recursing static arrays which,
Chris> although it comes unstuck in the same place as the 9067 recursing
Chris> static structs, comes unstuck in a different way and thus needs a
Chris> slightly different mechanism to detect.
Thanks.
A couple nits and then this is ok.
Chris> addr = value_address (val);
Chris> +
Chris> obstack_grow (&dont_print_statmem_obstack, (char *) &addr,
Chris> sizeof (CORE_ADDR));
Chris> CHECK_TYPEDEF (type);
Chris> +
Chris> cp_print_value_fields (type, value_enclosing_type (val),
Chris> value_contents_all (val),
Chris> value_embedded_offset (val), addr,
These two newline additions seem gratuitous.
Chris> + struct type * target_type = TYPE_TARGET_TYPE (type);
No space after the "*" here.
This is ok with those changes. Thanks.
Tom