+2015-04-28 Sasha Smundak <asmundak@google.com>
+
+ * NEWS: Mention gdb.Type.optimized_out method.
+ * python/py-type.c (typy_optimized_out): New function.
+
2015-04-28 John Baldwin <jhb@FreeBSD.org>
* fbsd-nat.c: Include "gdb_wait.h" instead of <sys/wait.h>.
which is the name of the objfile as specified by the user,
without, for example, resolving symlinks.
** You can now write frame unwinders in Python.
+ ** gdb.Type objects have a new method "optimized_out",
+ returning optimized out gdb.Value instance of this type.
* New commands
+2015-04-28 Sasha Smundak <asmundak@google.com>
+
+ * python.texi: New method documented.
+
2015-04-24 Andrew Burgess <andrew.burgess@embecosm.com>
* gdb.texinfo (Dump/Restore Files): Add detail about verilog dump
Otherwise, it is searched for globally.
@end defun
+@defun Type.optimized_out ()
+Return @code{gdb.Value} instance of this type whose value is optimized
+out. This allows a frame decorator to indicate that the value of an
+argument or a local variable is not known.
+@end defun
Each type has a code, which indicates what category this type falls
into. The available type categories are represented by constants
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 *
{ "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\
+2015-04-28 Sasha Smundak <asmundak@google.com>
+
+ * gdb.python/py-type.exp: New test.
+
2015-04-28 Andy Wingo <wingo@igalia.com>
* gdb.python/py-parameter.exp:
gdb_test "python print(gdb.lookup_type('char').array(1, -1))" \
"Array length must not be negative.*"
+gdb_test "python print(gdb.lookup_type('int').optimized_out())" \
+ "<optimized out>"
+
with_test_prefix "lang_c" {
runto_bp "break to inspect struct and array."
test_fields "c"