From bfd31e71181e450159f7540aaad11184544cabe0 Mon Sep 17 00:00:00 2001 From: Phil Muldoon Date: Thu, 3 Dec 2009 21:19:49 +0000 Subject: 2009-12-03 Richard Ward * python/py-type.c (convert_field): New attribute "is_base_class". doc/ 2009-12-03 Richard Ward * gdb.texinfo (Types In Python): Describe "is_base_class". testsuite/ 2009-12-03 Phil Muldoon PR python/10805 * gdb.python/py-type.exp: New file. * gdb.python/py-type.c: New file. * Makefile.in: Add py-type. --- gdb/python/py-type.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gdb/python') 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; -- cgit v1.1