Add gdb.Type.optimized_out method.
[deliverable/binutils-gdb.git] / gdb / python / py-type.c
index 39376a126f2a5bb23e76bbcfffce5611c04c4e63..648d8c8e1787519a8736249b3bf639c4f7b4be5b 100644 (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\
This page took 0.026229 seconds and 4 git commands to generate.