Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: matt rice <ratmice@gmail.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 5/7] [python] API for macros: gdb.Objfile symtabs method.
Date: Tue, 30 Aug 2011 17:34:00 -0000	[thread overview]
Message-ID: <m3ty8yby7m.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1314198654-9008-6-git-send-email-ratmice@gmail.com> (matt rice's	message of "Wed, 24 Aug 2011 08:10:52 -0700")

>>>>> "matt" == matt rice <ratmice@gmail.com> writes:

matt> 2011-08-23  Matt Rice  <ratmice@gmail.com>
matt> 	* python/py-symtab.h: New file.  Make symtab_to_symtab_object public.
matt> 	* python/py-objfile.c (objfpy_symtabs): New method.
matt> 	(objfile_object_methods): Ditto.

A couple notes on this.

matt> +static PyObject *
matt> +objfpy_symtabs (PyObject *self, PyObject *ignore)
matt> +{
matt> +  objfile_object *obj = (objfile_object *) self;
matt> +  struct symtab *symtabs;
matt> +  PyObject *list;
matt> +  PyObject *py_symtab;
matt> +
matt> +  if (! obj->objfile)
matt> +    return Py_None;

You need Py_RETURN_NONE.

I think most of our objects will throw an exception if you try to
operate on them when they are in the 'invalid' state; if that is true
then I think this should conform.

matt> +  while(symtabs)

Missing space.

matt> +  { "symtabs", objfpy_symtabs, METH_NOARGS,
matt> +    "symtabs () -> List.\n\
matt> +A List containing the object file's valid symtabs." },

I don't mind this method per se, but I think people will find it
confusing, as it only returns full symtabs -- but there is no direct way
for the Python programmer to cause symtab expansion.

matt> +PyObject *
matt> +symtab_to_symtab_object (struct symtab *symtab);

In addition to what Phil said, the norm is not to split declarations
after the type -- only definitions.

Tom


  parent reply	other threads:[~2011-08-30 17:34 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-24 15:11 [PATCH 0/7] [python] API for macros matt rice
2011-08-24 15:11 ` [PATCH 2/7] [python] API for macros: memory management quirks matt rice
2011-08-26 20:40   ` Tom Tromey
2011-08-30 11:47   ` Phil Muldoon
2011-09-01 22:46     ` Matt Rice
2011-08-24 15:11 ` [PATCH 5/7] [python] API for macros: gdb.Objfile symtabs method matt rice
2011-08-30 13:08   ` Phil Muldoon
2011-09-01 23:18     ` Matt Rice
2011-09-02  1:07       ` Paul_Koning
2011-08-30 17:34   ` Tom Tromey [this message]
2011-09-02  0:56     ` Matt Rice
2011-08-24 15:11 ` [PATCH 1/7] [python] API for macros: abort or continuing macro iterators matt rice
2011-08-26 20:23   ` Tom Tromey
2011-08-30 11:10   ` Phil Muldoon
2011-09-01 21:48     ` Matt Rice
2011-08-24 15:12 ` [PATCH 4/7] [python] API for macros: Add methods to get a gdb.Macro matt rice
2011-08-30 13:04   ` Phil Muldoon
2011-08-30 17:41     ` Tom Tromey
2011-08-30 20:28       ` Phil Muldoon
2011-08-30 20:35         ` Phil Muldoon
2011-09-01 23:13           ` Matt Rice
2011-09-02  1:15             ` Paul_Koning
2011-09-02 10:04               ` Paul_Koning
2011-09-02 12:04             ` Phil Muldoon
2011-08-30 20:38         ` Tom Tromey
2011-08-30 20:58           ` Phil Muldoon
2011-08-24 15:12 ` [PATCH 3/7] [python] API for macros: Add gdb.Macro class matt rice
2011-08-30 12:45   ` Phil Muldoon
2011-09-01 22:57     ` Matt Rice
2011-08-24 15:12 ` [PATCH 6/7] [python] API for macros: Add docs matt rice
2011-08-24 20:10   ` Eli Zaretskii
2011-08-25 12:33     ` Matt Rice
2011-08-25 17:36       ` Eli Zaretskii
2011-08-26  8:04         ` Matt Rice
2011-08-26 10:42           ` Eli Zaretskii
2011-08-26 11:17             ` Matt Rice
2011-08-26 12:08               ` Eli Zaretskii
2011-08-26 14:06                 ` Matt Rice
2011-08-26 15:05                   ` Eli Zaretskii
2011-08-24 15:12 ` [PATCH 7/7] [python] API for macros: Add tests matt rice
2011-08-30 13:12   ` Phil Muldoon
2011-08-30 15:54   ` Tom Tromey
2011-08-30  9:44 ` [PATCH 0/7] [python] API for macros Phil Muldoon
2011-09-01 21:33   ` Matt Rice

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=m3ty8yby7m.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=ratmice@gmail.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