Add gdb.Type.optimized_out method.

gdb/ChangeLog:

	* NEWS: Mention gdb.Type.optimized_out method.
	* python/py-type.c (typy_optimized_out):  New function.

gdb/doc/ChangeLog:

	* python.texi: New method documented.

gdb/testsuite/ChangeLog:

	* gdb.python/py-type.exp: New test.
This commit is contained in:
Sasha Smundak 2015-04-28 17:41:09 -07:00 committed by Doug Evans
parent 521f2feb98
commit 59fb7612dd
7 changed files with 36 additions and 0 deletions

View file

@ -1181,6 +1181,16 @@ typy_nonzero (PyObject *self)
return 1;
}
/* Return optimized out value of this type. */
static PyObject *
typy_optimized_out (PyObject *self, PyObject *args)
{
struct type *type = ((type_object *) self)->type;
return value_to_value_object (allocate_optimized_out_value (type));
}
/* Return a gdb.Field object for the field named by the argument. */
static PyObject *
@ -1493,6 +1503,9 @@ They are first class values." },
{ "const", typy_const, METH_NOARGS,
"const () -> Type\n\
Return a const variant of this type." },
{ "optimized_out", typy_optimized_out, METH_NOARGS,
"optimized_out() -> Value\n\
Return optimized out value of this type." },
{ "fields", typy_fields, METH_NOARGS,
"fields () -> list\n\
Return a list holding all the fields of this type.\n\