diff options
author | Sasha Smundak <asmundak@google.com> | 2015-04-28 17:41:09 -0700 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2015-04-28 17:41:09 -0700 |
commit | 59fb7612ddee9219817a0c33b7d533b3d1c2aa41 (patch) | |
tree | 242ca16dfed9cf2a96d4bc17f863912d06d556cf /gdb/python | |
parent | 521f2feb982e5e0b7065f5096590c3a92c7c9ec0 (diff) | |
download | gdb-59fb7612ddee9219817a0c33b7d533b3d1c2aa41.zip gdb-59fb7612ddee9219817a0c33b7d533b3d1c2aa41.tar.gz gdb-59fb7612ddee9219817a0c33b7d533b3d1c2aa41.tar.bz2 |
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.
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-type.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c index 39376a1..648d8c8 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c @@ -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\ |