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: Wed, 08 Apr 2009 18:26:00 -0000	[thread overview]
Message-ID: <m3d4bnxarl.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:

Tom> +  if (except.reason < 0)
Tom> +    {
Tom> +      PyErr_Format (except.reason == RETURN_QUIT
Tom> +		    ? PyExc_KeyboardInterrupt : PyExc_RuntimeError,
Tom> +		    "%s", except.message);
Tom> +      return NULL;
Tom> +    }

Thiago> Perhaps this is nitpicking, but: any reason why you don't use
Thiago> GDB_PY_HANDLE_EXCEPTION here? This code seems to do the same thing.

GDB_PY_HANDLE_EXCEPTION does "return PyErr_Format...", which means the
return uses the wrong type.  (I didn't see this at first either, I
found out by trying :-)

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

I changed a few to be attributes: code, sizeof, and tag.

The rest I left as methods.  It seemed reasonable to me that requests
for type variants (or pointer-to or reference-to or whatever) should
be methods.  They may cause a new type to be created.

Tom


  parent reply	other threads:[~2009-04-08 18:26 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
2009-04-08 18:26   ` Tom Tromey [this message]
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=m3d4bnxarl.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