This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] [python libstdc++ printers] Fix gdb/15195
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: gcc-patches at sourceware dot org, libstdc <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 18 Jul 2013 07:59:59 -0600
- Subject: Re: [patch] [python libstdc++ printers] Fix gdb/15195
- References: <514ADF9B dot 1090407 at redhat dot com> <87mwtw4yy6 dot fsf at fleche dot redhat dot com> <51B6E3C5 dot 3000209 at redhat dot com> <87sj0mglyg dot fsf at fleche dot redhat dot com> <51D3D3C6 dot 2030001 at redhat dot com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> 2013-07-03 Phil Muldoon <pmuldoon@redhat.com>
Phil> PR gcc/53477
Phil> http://sourceware.org/bugzilla/show_bug.cgi?id=15195
Phil> * python/libstdcxx/v6/printers.py (Printer.__call__): If a value
Phil> is a reference, fetch referenced value.
Phil> (RxPrinter.invoke): Ditto.
Phil> * testsuite/libstdc++-prettyprinters/cxx11.cc (main): Add -O0
Phil> flag. Add referenced value tests.
Thanks Phil.
Remember to CC <libstdc++@gcc.gnu.org> on these notes.
Phil> + if value.type.code == gdb.TYPE_CODE_REF:
Phil> + value = value.referenced_value()
Phil> +
I think this code should test for the existence of referenced_value
using hasattr. Maybe somebody is still on gdb 7.4.
Tom