summaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorPedro Alves <pedro@codesourcery.com>2011-02-14 11:33:24 +0000
committerPedro Alves <pedro@codesourcery.com>2011-02-14 11:33:24 +0000
commit2c53f3057e87a0683610f93ca295c4149ce0f589 (patch)
treeff2f12d633c90b3720f51e3dc8bcf3466cb78a8e /gdb/value.c
parentc4f121580815d0d2767fed6906098f1a494472d8 (diff)
downloadgdb-2c53f3057e87a0683610f93ca295c4149ce0f589.tar.gz
gdb/testsuite/
* gdb.trace/unavailable.cc (struct Virtual): New. (virtualp): New global pointer. * gdb.trace/unavailable.exp (gdb_collect_globals_test): Test printing a pointer to an object whose type has a vtable, with print object on. gdb/ * value.h (value_entirely_available): Declare. * value.c (value_entirely_available): New function. * c-valprint.c (c_value_print): Don't try fetching the pointer's real type if the pointer is unavailable.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 806101910d2..236b42f12a5 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -331,6 +331,19 @@ value_bytes_available (const struct value *value, int offset, int length)
return !ranges_contain (value->unavailable, offset, length);
}
+int
+value_entirely_available (struct value *value)
+{
+ /* We can only tell whether the whole value is available when we try
+ to read it. */
+ if (value->lazy)
+ value_fetch_lazy (value);
+
+ if (VEC_empty (range_s, value->unavailable))
+ return 1;
+ return 0;
+}
+
void
mark_value_bytes_unavailable (struct value *value, int offset, int length)
{