[RFA] Python: iterator for deep traversal of gdb.Type struct/union fields

Doug Evans dje@google.com
Thu Oct 27 13:01:00 GMT 2011


On Wed, Oct 26, 2011 at 8:11 AM, Paul Koning <paulkoning@comcast.net> wrote:
>
> On Oct 25, 2011, at 4:12 PM, Eli Zaretskii wrote:
>
>>> From: Paul Koning <paulkoning@comcast.net>
>>> Date: Tue, 25 Oct 2011 14:54:21 -0400
>>> Cc: Tom Tromey <tromey@redhat.com>, Li Yu <raise.sail@gmail.com>
>>>
>>> +@item deepitems (@var{type})
>>> +Returns a Python iterator similar to the standard
>>> +@code{gdb.Type.iteritems ()} method, except that the iterator returned
>>                            ^^
>> Please lose the parentheses.  You just want the method's name, and you
>> already say that it's a method.  So the parentheses don't add anything
>> except potential confusion.
>>
>>> +@end smallexample
>>> +
>>> +Then in gdb:
>>
>> You want @noindent before "Then in gdb", to make it look like
>> continuation of the previous paragraph, not a beginning of a new one.
>>
>> Also, please use @value{GDBN} instead of a literal "gdb".
>>
>>> +(gdb) python import gdb.types
>>
>> We use @value{GDBP} instead of a literal "(gdb)".
>>
>> OK with those changes.
>
> Thanks.  Committed with those changes.

Hi.  Is it too late to change the name to deep_items?

I like consistency in the user-facing API and we've been using foo_bar
(as does PEP008).

[Or is there a special reason for eliding the underscore?]

TIA



More information about the Gdb-patches mailing list