This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFC/Patch v2] PR 16113: Allow gdb.Field objects as subscripts on gdb.Value objects


The attached patch addresses Eli's and Phil Muldoon's comments.

As before, the doc and NEWS changes do not include the description
about the 'parent_type' attribute, which this patch adds to gdb.Field
objects.

2013-12-09  Siva Chandra Reddy  <sivachandra@google.com>

        PR 16113: Allow gdb.Field objects with the subscript operator on
        gdb.Value objects of struct/class values.
        * NEWS (Python Scripting): Add entry for the new feature.
        * python/py-type.c (gdbpy_is_field): New function
        (convert_field): Add 'parent_type' attribute to gdb.Field
        objects.
        * python/py-value.c (valpy_getitem): Allow subscript value to be
        a gdb.Field object.
        (value_has_field): New function
        (get_field_flag): New function
        * python/python-internal.h (gdbpy_is_field): Add declaration.

        testsuite/
        * gdb.python/py-value-cc.cc: Improve test case.
        * gdb.python/py-value-cc.exp: Add new tests.

        doc/
        * gdb.texinfo (Values From Inferior): Add a note about using
        gdb.Field objects as subscripts on gdb.Value objects.

Attachment: value_field_subscript_patch_v2.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]