This is the mail archive of the
mailing list for the Archer project.
Re: Should users be protected from badly-recursive pretty printers?
- From: Tom Tromey <tromey at redhat dot com>
- To: ppluzhnikov at google dot com (Paul Pluzhnikov)
- Cc: archer at sourceware dot org
- Date: Tue, 04 Nov 2008 12:51:20 -0700
- Subject: Re: Should users be protected from badly-recursive pretty printers?
- References: <20081104193925.0D1293A6B0B@localhost>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Paul" == Paul Pluzhnikov <firstname.lastname@example.org> writes:
Paul> Above pretty printer is infinitely recursive, even though this may
Paul> not be apparent to a casual GDB user.
I've also been wondering whether we want pretty-printing at both the
value_ and the val_ layers. It seems a bit weird.
Paul> Using that pretty printer also produces "strange" result (there is no
Paul> "out-of-stack due to recursion too deep" inidication):
That is odd.
Paul> What (if anything) could (or should?) be done about this?
We could keep a hash of values that we have seen and throw an
exception if one is reused. This is a mild pain due to the val_print
code. Alternatively we could avoid recursion by disabling
pretty-printing the second time.