Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Phil Muldoon <pmuldoon@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [patch][python] 5 of 5 - Frame filter documentation changes
Date: Fri, 19 Apr 2013 14:24:00 -0000	[thread overview]
Message-ID: <516FE364.4040604@redhat.com> (raw)
In-Reply-To: <87k3ozxsoq.fsf@fleche.redhat.com>

> FrameDecorator also stores this in an attribute, "base".
> Should that attribute just be declared public?
> And if not, shouldn't it be renamed to start with a "_"?
> 
> Phil> +    def function(self):
> Phil> +        frame = self.inferior_frame()
> Phil> +        name = str(frame.name())
> Phil> +        function = str(frame.function())
> Phil> +
> Phil> +        if frame.type() == gdb.INLINE_FRAME:
> Phil> +            name = name + " [inlined from "+ function +"]"
> 
> This actually violates the FrameDecorator guidelines, since it bypasses
> self.base to get the name from the inferior_frame.
> 
> It seems like it should call self.base.name() instead.
> And, it should have a comment explaining why it needs to use
> inferior_frame to call function.

This frame decorator does not have an inferior_frame API declared, so
in the case of the call to inferior_frame, it calls the super class's
inferior_function API (which in this case, will return self.base).
I'll rename self.base to self._base, in the Frame Decorator.  This
example is just deferring the call to the frame decorator that
actually wraps the gdb.Frame.

> Phil> +        try:
> Phil> +            eliding_frame = next(self.input_iterator)
> Phil> +        except StopIteration:
> Phil> +            return frame
> Phil> +        return ElidingFrameDecorator(eliding_frame, [frame])
> 
> What if there are multiple inline frames in a row?
> Wouldn't you want to elide all of them?
> That will make the example trickier though.

Yeah there are several edge cases I did not cover.  I did write an
explanatory passage before this example noting that it just covers one
view, and, there are many other cases to deal with.  I noted the scope
of a manual example can't encompass these.

Cheers,

Phil


  reply	other threads:[~2013-04-18 12:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-11 22:14 Phil Muldoon
2013-03-12 17:24 ` Eli Zaretskii
2013-03-22 19:54 ` Tom Tromey
2013-04-19 14:24   ` Phil Muldoon [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-05-06  8:24 Phil Muldoon
2013-04-22 17:03 Phil Muldoon
2013-04-26 11:54 ` Tom Tromey
2013-05-10 10:52   ` Phil Muldoon
2012-11-30 14:32 Phil Muldoon
2012-12-01 10:59 ` Eli Zaretskii
2012-12-05 19:11   ` Tom Tromey
2012-12-07 14:35   ` Phil Muldoon
2012-12-07 15:04     ` Eli Zaretskii
2012-12-07 15:34       ` Phil Muldoon
2012-12-07 15:54       ` Eli Zaretskii
2012-12-05 20:49 ` Tom Tromey
2012-12-07 14:55   ` 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=516FE364.4040604@redhat.com \
    --to=pmuldoon@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@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