From b5b08fb4ffa53ec088f8ad865bee0fd6edb2906f Mon Sep 17 00:00:00 2001 From: Siva Chandra Date: Fri, 27 Dec 2013 12:20:59 -0800 Subject: Use bitpos and type to lookup a gdb.Field object when its name is 'None'. PR python/15464 PR python/16113 * valops.c (value_struct_elt_bitpos): New function * py-type.c (convert_field): Set 'name' attribute of a gdb.Field object to 'None' if the field name is an empty string (""). * python/py-value.c (valpy_getitem): Use 'bitpos' and 'type' attribute to look for a field when 'name' is 'None'. (get_field_type): New function testsuite/ * gdb.python/py-type.c: Enhance test case. * gdb.python/py-value-cc.cc: Likewise * gdb.python/py-type.exp: Add new tests. * gdb.python/py-value-cc.exp: Likewise --- gdb/value.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gdb/value.h') diff --git a/gdb/value.h b/gdb/value.h index 5924b2f5b2..f8466690e0 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -670,6 +670,11 @@ extern struct value *value_struct_elt (struct value **argp, const char *name, int *static_memfuncp, const char *err); +extern struct value *value_struct_elt_bitpos (struct value **argp, + int bitpos, + struct type *field_type, + const char *err); + extern struct value *value_aggregate_elt (struct type *curtype, char *name, struct type *expect_type, -- cgit v1.2.3