This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Re: Python: add field access by name and standard python mapping methods to gdb.Type
- From: Paul Koning <paulkoning at comcast dot net>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Doug Evans <dje at google dot com>, gdb-patches at sourceware dot org
- Date: Tue, 4 Oct 2011 11:29:58 -0400
- Subject: Re: [RFA] Re: Python: add field access by name and standard python mapping methods to gdb.Type
- References: <A3E6FC3B-1E11-4F34-817E-897C74B2A669@comcast.net> <m3hb4c935j.fsf@redhat.com> <3A3AF5AE-70E8-43D0-B8CE-DCADFEEF879A@comcast.net> <CADPb22RTizsTBzTHQ6SZbsW_sv7FNCZD6EQeLacNWtAWNRcZWQ@mail.gmail.com> <F08522DE-7678-410E-92E5-2692482305AF@comcast.net> <CADPb22SrXdBoU5KRjDJ8aox=ne9pV9Sht1qemgkC_LaOLjK51w@mail.gmail.com> <560557F2-1B8B-4633-8CD6-E63705EEAF0E@comcast.net> <m3ipo4rdqj.fsf@fleche.redhat.com>
On Oct 4, 2011, at 11:13 AM, Tom Tromey wrote:
>>>>>> "Paul" == Paul Koning <paulkoning@comcast.net> writes:
>
> Paul> Thanks. Committed with these changelogs, same diff as previously mailed:
>
> Paul> * doc/gdb.texinfo (gdb.Type): Document field access by dictionary
> Paul> key syntax.
>
> For future reference, there is a separate ChangeLog in doc. Entries for
> documentation have to go there.
I overlooked that file. Thanks for the reference. Should I move the entry there?
>
> Paul> 2011-09-28 Paul Koning <paul_koning@dell.com>
> Paul> * gdb.python/py-type.c (enum E): New.
> Paul> * gdb.python/py-type.exp (test_fields): Add tests for Python
> Paul> mapping access to fields.
> Paul> (test_enums): New test for field access on enums.
>
> Could you write a NEWS entry for this change?
How about this?
paul
2011-10-04 Paul Koning <paul_koning@dell.com>
* NEWS: Add entry for Python gdb.Type mapping methods.
Index: NEWS
===================================================================
RCS file: /cvs/src/src/gdb/NEWS,v
retrieving revision 1.453
diff -u -r1.453 NEWS
--- NEWS 15 Sep 2011 12:27:18 -0000 1.453
+++ NEWS 4 Oct 2011 15:28:44 -0000
@@ -41,6 +41,11 @@
** The "gdb.breakpoint" function has been deprecated in favor of
"gdb.breakpoints".
+ ** Type objects for struct and union types now allow access to
+ the fields using standard Python dictionary (mapping) methods.
+ For example, "some_type['myfield']" now works, as does
+ "some_type.items()".
+
* libthread-db-search-path now supports two special values: $sdir and $pdir.
$sdir specifies the default system locations of shared libraries.
$pdir specifies the directory where the libpthread used by the application