This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR10687 Printing c++ class with static array (of same type) can produce infinite output


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]