Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Phil Muldoon <pmuldoon@redhat.com>
Cc: "gdb-patches\@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch] [python] Fix Python 3 build and testsuite issues
Date: Wed, 21 Aug 2013 14:56:00 -0000	[thread overview]
Message-ID: <87a9kbf5xq.fsf@fleche.redhat.com> (raw)
In-Reply-To: <5213D26D.4070003@redhat.com> (Phil Muldoon's message of "Tue, 20	Aug 2013 21:32:45 +0100")

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


  parent reply	other threads:[~2013-08-21 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-19 14:50 Phil Muldoon
2013-08-19 16:19 ` Tom Tromey
2013-08-19 16:45   ` Phil Muldoon
2013-08-19 18:34     ` Tom Tromey
2013-08-20 19:43       ` Phil Muldoon
2013-08-20 19:59         ` Tom Tromey
2013-08-20 20:32           ` Phil Muldoon
2013-08-21 14:29             ` Phil Muldoon
2013-08-21 14:59               ` Tom Tromey
2013-08-21 15:37                 ` Paul_Koning
2013-08-21 15:42                   ` Tom Tromey
2013-08-21 14:56             ` Tom Tromey [this message]
2013-08-22 10:46               ` Phil Muldoon
2013-08-27 15:41                 ` Tom Tromey
2013-08-29 10:08                   ` Phil Muldoon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a9kbf5xq.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pmuldoon@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox