Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Python pretty-printing [3/6]
Date: Mon, 06 Apr 2009 23:32:00 -0000	[thread overview]
Message-ID: <m3ab6t2w9x.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1238790861.3236.72.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Fri\, 03 Apr 2009 17\:34\:21 -0300")

>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Thiago> I think most of these methods could be attributes instead.

Ok.

Thiago> The ones which should stay as methods are those who have
Thiago> side-effects (like causing a symtab to be loaded, or
Thiago> somesuch). Even the methods which create new types only do so
Thiago> if the requested type doesn't exist yet, IIUC. Are there
Thiago> side-effects in, say, Type.pointer or Type.reference?

Only allocation, as far as I can tell.  That seems safe enough.

Thiago> Also, another no-no for an attribute would be if its getter
Thiago> would throw an exception.
Thiago> WDYT?

I'll do it.

This strengthens the argument for changing the Type constructor now,
if we want to.  We might as well make all the changes at once :) What
do you think of a static method named "Type.lookup"?  Daniel?

Thiago> What about making Value.type an attribute?

I remember thinking that we couldn't memoize a value's Type.
But now I'm thinking that I remember this from before type reference
counting; and on the branch it seems like it ought to be safe.

Type is still a bit weird.  We don't have a way to compare Type
objects, which makes them hard to use in dictionaries and whatnot.
One idea would be to compare the underlying struct type, with the
proviso that, in the current gdb, this won't always work correctly for
types with no associated objfile.  This would be an improvement, at
least, and we could lift this restriction later.

Tom


  reply	other threads:[~2009-04-06 23:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 20:55 Tom Tromey
2009-04-03 15:16 ` Eli Zaretskii
2009-04-07 19:52   ` Tom Tromey
2009-04-07 21:45     ` Eli Zaretskii
2009-04-03 16:30 ` Daniel Jacobowitz
2009-04-06 23:26   ` Tom Tromey
2009-04-07  0:34     ` Thiago Jung Bauermann
2009-04-07  1:16     ` Daniel Jacobowitz
2009-04-07  2:03       ` Thiago Jung Bauermann
2009-04-07  2:27         ` Daniel Jacobowitz
2009-04-03 20:34 ` Thiago Jung Bauermann
2009-04-06 23:32   ` Tom Tromey [this message]
2009-04-08 18:26   ` Tom Tromey
2009-04-08 18:39 ` Tom Tromey
2009-04-08 19:23   ` Eli Zaretskii
2009-04-09  1:16     ` Tom Tromey

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=m3ab6t2w9x.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    /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