aboutsummaryrefslogtreecommitdiff
path: root/gdb/doc
diff options
context:
space:
mode:
authorPaul Koning <pkoning@equallogic.com>2011-09-28 20:04:52 +0000
committerPaul Koning <pkoning@equallogic.com>2011-09-28 20:04:52 +0000
commita73bb89264f459f0a273b46f32ce911fa82ef92d (patch)
tree95713718db2032e0cbacbe6642854d9685161957 /gdb/doc
parent514c97d3e0e09f75366b973f214441d8cd019c8f (diff)
downloadgdb-a73bb89264f459f0a273b46f32ce911fa82ef92d.zip
gdb-a73bb89264f459f0a273b46f32ce911fa82ef92d.tar.gz
gdb-a73bb89264f459f0a273b46f32ce911fa82ef92d.tar.bz2
* python/py-type.c (make_fielditem, typy_field_names, typy_items)
(typy_length, typy_get, typy_has_key, typy_make_iter) (typy_iterkeys, typy_iteritems, typy_itervalues, typy_iter) (typy_iterator_iter, typy_iterator_iternext) (typy_iterator_dealloc): New functions to implement standard Python mapping methods on gdb.Type object. (gdb.TypeIterator): New Python type. * python/python-internal.h (gdbpy_iter_kind): New enum. * doc/gdb.texinfo (gdb.Type): Document field access by dictionary key syntax.
Diffstat (limited to 'gdb/doc')
-rw-r--r--gdb/doc/gdb.texinfo15
1 files changed, 14 insertions, 1 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index c8bb006..d558ee7 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21541,6 +21541,19 @@ Ordinarily, this function will return an instance of @code{gdb.Type}.
If the named type cannot be found, it will throw an exception.
@end defun
+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} field with:
+
+@smallexample
+bar = some_type['foo']
+@end smallexample
+
+@code{bar} will be a @code{gdb.Field} object; see below under the
+description of the @code{Type.fields} method for a description of the
+@code{gdb.Field} class.
+
An instance of @code{Type} has the following attributes:
@table @code
@@ -21574,7 +21587,7 @@ field per parameter. The base types of C@t{++} classes are also
represented as fields. If the type has no fields, or does not fit
into one of these categories, an empty sequence will be returned.
-Each field is an object, with some pre-defined attributes:
+Each field is a @code{gdb.Field} object, with some pre-defined attributes:
@table @code
@item bitpos
This attribute is not available for @code{static} fields (as in