This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] [python] Fix Python 3 build and testsuite issues
- From: Tom Tromey <tromey at redhat dot com>
- To: Phil Muldoon <pmuldoon at redhat dot com>
- Cc: "gdb-patches\ at sourceware dot org" <gdb-patches at sourceware dot org>
- Date: Wed, 21 Aug 2013 08:56:49 -0600
- Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues
- References: <521230C8 dot 2040803 at redhat dot com> <878uzxlkl1 dot fsf at fleche dot redhat dot com> <52124B8D dot 6010609 at redhat dot com> <87ppt9jzrl dot fsf at fleche dot redhat dot com> <5213C6BA dot 7030703 at redhat dot com> <87d2p8gmlo dot fsf at fleche dot redhat dot com> <5213D26D dot 4070003 at redhat dot com>
>>>>> "Phil" == Phil Muldoon <pmuldoon@redhat.com> writes:
Phil> For the hasattr point, I believe the equivalent check is the same in
Phil> this version, as the incompatible Python 3 frame filters code. But I
Phil> use several methods of gdb.Symbol so which one would we use? Remember
Phil> this is not the Symbol/Value like interface that frame_args, and
Phil> frame_locals returns, but the actual return of the symbol() function
Phil> from that interface. At this point in the code we have already called
Phil> that symbol() API and have the object it returned.
We could pick any unique-to-Symbol method as a sentinel.
Say, the first one called in this method.
Phil> See SymValueWrapper class in FrameDecorator.py. This object interface
Phil> specifies that it must return either a string, or a gdb.Symbol. I
Phil> suppose you could return a Symbol like object, but you would have to
Phil> implement pretty much all of the gdb.Symbol methods. This would not
Phil> make a great deal of sense. Instead we should make gdb.Symbol
Phil> inheritable, so the user can sub-class. This new child class of
Phil> gdb.Symbol would still work with the above code as the code makes no
Phil> assumptions of the class other than it has the available methods.
I think subclassing Symbol is problematic.
For example I think it means it is hard to make a purely synthetic one.
What would the native state look like? Where would it come from?
It seems better to go with Python's duck-typing approach instead.
Tom