This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: [python] make FrameWrapper a real wrapper
- From: Alexander Larsson <alexl at redhat dot com>
- To: tromey at redhat dot com
- Cc: Project Archer <archer at sourceware dot org>
- Date: Mon, 21 Sep 2009 09:37:33 +0200
- Subject: Re: [python] make FrameWrapper a real wrapper
- References: <m3iqffc2jr.fsf@fleche.redhat.com>
On Fri, 2009-09-18 at 16:26 -0600, Tom Tromey wrote:
> I'm checking this in on the python branch.
>
> This changes FrameWrapper so that it never directly calls a method on
> self.frame. Instead, it relies on __getattr__ to do the right thing.
>
> This is nice because it means you can subclass FrameWrapper and
> intercept any of these calls.
>
> I think this should eliminate one reason for monkey-patching the frame
> code in the glib printers: https://bugzilla.gnome.org/show_bug.cgi?id=595619#c1
> Alex, does this actually help?
No, it doesn't. Because the backtracing code will construct FrameWrapper
objects, not my subclasses of it.
What happens is that I will create a wrapper similar to FrameWrapper
that does filtering stuff, and then the backtrace code will chain all
these toghether with FrameWrapper as the innermost wrapper of the actual
frame.
So, when something calls describe on my wrapper it will either do stuff,
or pass onto its wrapped object totally. Eventually it will reach
FrameWrapper.describe() which will call self.name() to get the name.
This "name" is looked up on the FrameWrapper, not on my filters frame
wrapper object though, so will be unaffected by whatever I do.