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.
This commit is contained in:
Phil Muldoon
2009-12-03 21:19:49 +00:00
parent 57a1d73695
commit bfd31e7118
8 changed files with 201 additions and 1 deletions

View File

@ -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;