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 [2/6]
Date: Fri, 03 Apr 2009 00:23:00 -0000	[thread overview]
Message-ID: <m31vsabn5q.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1238711355.3236.51.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Thu\, 02 Apr 2009 19\:29\:14 -0300")

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

Tom> This patch adds a minimal Python wrapper for struct objfile,
Tom> and arranges to auto-load Python code when an objfile is created.

Thiago> Hooray. Just a few comments...

Thanks for looking at this.  I've found that seeing the Python patches
again, out of context, helps me look at them anew.  Apparently this
works for you too :-)

Thiago> IMHO these should go in the "Objfiles In Python" section, like e.g.
Thiago> gdb.selected_frame goes in the "Frames In Python" section.

Thanks, will do.

Thiago> So perhaps you should:

>   tmp = self->printers;
>   Py_INCREF (value);
>   self->printers = value;
>   Py_XDECREF (tmp);

Thiago> You certainly have more experience in this area than me though. WDYT?

Good catch.  I will make this change.  I think one failing case is
just:

    objfile.pretty_printers = objfile.pretty_printers

Tom> +/* Return the Python object of type Objfile representing OBJFILE.  If
Tom> +   the object has already been created, return it.  Otherwise, create
Tom> +   it.  Return NULL and set the Python error on failure.  */
Tom> +PyObject *
Tom> +objfile_to_objfile_object (struct objfile *objfile)

Thiago> Perhaps it would be useful to mention that this function returns a
Thiago> borrowed reference to the object?

Will do.

Thiago> Also, just to check: the lack of testcases is because you believe this
Thiago> code is tested enough with python-prettyprint.exp in a later patch?

You know, I am not sure.  This class doesn't provide much behavior
yet.  And, the most important bits are tested by the pretty-printer.
I'm inclined not to bother, but if you (or anybody) thinks it is
important, I suppose I can whip something up.

Tom


  reply	other threads:[~2009-04-03  0:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-02 20:55 Tom Tromey
2009-04-02 22:29 ` Thiago Jung Bauermann
2009-04-03  0:23   ` Tom Tromey [this message]
2009-04-03  0:47     ` Tom Tromey
2009-04-03 15:06       ` Eli Zaretskii
2009-04-06 19:25         ` Tom Tromey
2009-04-06 20:41           ` Eli Zaretskii
2009-04-03 20:36     ` Thiago Jung Bauermann

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=m31vsabn5q.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