aboutsummaryrefslogtreecommitdiff
path: root/gdb/valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/valprint.c')
-rw-r--r--gdb/valprint.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/gdb/valprint.c b/gdb/valprint.c
index c053a81..7e74856 100644
--- a/gdb/valprint.c
+++ b/gdb/valprint.c
@@ -34,6 +34,7 @@
#include "ada-lang.h"
#include "gdb_obstack.h"
#include "charset.h"
+#include "typeprint.h"
#include <ctype.h>
/* Maximum number of wchars returned from wchar_iterate. */
@@ -303,6 +304,18 @@ valprint_check_validity (struct ui_file *stream,
{
type = check_typedef (type);
+ if (type_not_associated (type))
+ {
+ val_print_not_associated (stream);
+ return 0;
+ }
+
+ if (type_not_allocated (type))
+ {
+ val_print_not_allocated (stream);
+ return 0;
+ }
+
if (TYPE_CODE (type) != TYPE_CODE_UNION
&& TYPE_CODE (type) != TYPE_CODE_STRUCT
&& TYPE_CODE (type) != TYPE_CODE_ARRAY)
@@ -1043,6 +1056,18 @@ value_check_printable (struct value *val, struct ui_file *stream,
return 0;
}
+ if (type_not_associated (value_type (val)))
+ {
+ val_print_not_associated (stream);
+ return 0;
+ }
+
+ if (type_not_allocated (value_type (val)))
+ {
+ val_print_not_allocated (stream);
+ return 0;
+ }
+
return 1;
}