Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Paul Koning <paulkoning@comcast.net>
Cc: gdb-patches@sourceware.org
Subject: Re: Python: add field access by name and standard python mapping methods to gdb.Type
Date: Fri, 16 Sep 2011 07:36:00 -0000	[thread overview]
Message-ID: <83ty8dugmp.fsf@gnu.org> (raw)
In-Reply-To: <A3E6FC3B-1E11-4F34-817E-897C74B2A669@comcast.net>

> From: Paul Koning <paulkoning@comcast.net>
> Date: Thu, 15 Sep 2011 16:38:33 -0400
> 
> The attached proposed patch adds access to struct and enum fields by their name, just as field names can be used on gdb.Value objects.  It also adds the standard Python methods for mappings (dictionary-like objects), so that the kind of things that Python programmers would expect to work on objects that can be indexed by name indeed do work.  For example, you can iterate through the fields, or query if a field name exists.  

Comments for the documentation part:

> +If the type is a structure or class type, or an enum type, the fields
> +of that type can be accessed using the Python @dfn{dictionary syntax}.
> +For example, if @code{some_type} is a @code{gdb.Type} instance holding
> +a structure type, you can access its @code{foo} element with:
                                                   ^^^^^^^
For consistency with preceding text, I suggest to use "field" here.

> +@code{bar} will be a @code{gdb.Field} object; see below under the
> +description of the @code{fields()} method for a description of the

"@code{fields}", without the parens.  If you use the parentheses, it
looks like a call to `fields' with no arguments, which is not what you
want.

In general, good Texinfo usage and GNU standards frown on the man-page
tradition of using "()" to indicate that the symbol is a function.

> +gdb.Field class.

Forgot @code here.

> +Each field is an @code{gdb.Field} object, with some pre-defined attributes:
                 ^^
"a"

Okay with those changes.

Thanks.


  reply	other threads:[~2011-09-16  6:49 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-16  4:09 Paul Koning
2011-09-16  7:36 ` Eli Zaretskii [this message]
2011-09-16 10:47 ` Phil Muldoon
2011-09-16 14:57   ` Paul Koning
2011-09-16 14:57     ` Phil Muldoon
2011-09-16 15:41   ` Paul Koning
2011-09-23 17:21     ` Doug Evans
2011-09-26 17:15       ` [RFA] " Paul Koning
2011-09-28 19:25         ` Doug Evans
2011-09-28 20:41           ` Paul Koning
2011-10-04 15:14             ` Tom Tromey
2011-10-04 15:30               ` Paul Koning
2011-10-04 15:42                 ` Eli Zaretskii
2011-10-04 15:56                   ` Paul Koning
2011-11-04 17:42                     ` Doug Evans
2011-11-04 20:41                       ` Paul Koning
2011-11-04 23:05                         ` Doug Evans
2011-11-05 14:36                           ` Paul Koning
2011-11-05 21:04                             ` Doug Evans
2011-11-08 21:40                               ` [RFA] Python: raise exception on field-related gdb.Type methods if it's not struct or union Paul Koning
2011-11-09  0:29                                 ` Doug Evans
2011-11-09  1:53                                   ` Paul Koning
2011-11-09 18:10                                   ` Paul Koning
2011-11-15 19:01                                     ` [PING] " Paul Koning
2011-11-15 20:57                                       ` Doug Evans
2011-11-15 21:21                                         ` Paul Koning

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=83ty8dugmp.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    --cc=paulkoning@comcast.net \
    /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