aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorPhil Muldoon <pmuldoon@redhat.com>2009-12-03 21:19:49 +0000
committerPhil Muldoon <pmuldoon@redhat.com>2009-12-03 21:19:49 +0000
commitbfd31e71181e450159f7540aaad11184544cabe0 (patch)
tree031e40b0a29918e607b1ce9921f8c02364f93379 /gdb/python
parent57a1d736959fb92e39abab59511a903b7ec59547 (diff)
downloadgdb-bfd31e71181e450159f7540aaad11184544cabe0.zip
gdb-bfd31e71181e450159f7540aaad11184544cabe0.tar.gz
gdb-bfd31e71181e450159f7540aaad11184544cabe0.tar.bz2
2009-12-03 Richard Ward <richard.j.ward1@googlemail.com>
* python/py-type.c (convert_field): New attribute "is_base_class". doc/ 2009-12-03 Richard Ward <richard.j.ward1@googlemail.com> * gdb.texinfo (Types In Python): Describe "is_base_class". testsuite/ 2009-12-03 Phil Muldoon <pmuldoon@redhat.com> PR python/10805 * gdb.python/py-type.exp: New file. * gdb.python/py-type.c: New file. * Makefile.in: Add py-type.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-type.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c
index 590d90a..e73185e 100644
--- a/gdb/python/py-type.c
+++ b/gdb/python/py-type.c
@@ -169,6 +169,14 @@ convert_field (struct type *type, int field)
if (PyObject_SetAttrString (result, "artificial", arg) < 0)
goto failarg;
+ if (TYPE_CODE (type) == TYPE_CODE_CLASS)
+ arg = field < TYPE_N_BASECLASSES (type) ? Py_True : Py_False;
+ else
+ arg = Py_False;
+ Py_INCREF (arg);
+ if (PyObject_SetAttrString (result, "is_base_class", arg) < 0)
+ goto failarg;
+
arg = PyLong_FromLong (TYPE_FIELD_BITSIZE (type, field));
if (!arg)
goto fail;