summaryrefslogtreecommitdiff
path: root/gdb/typeprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/typeprint.c')
-rw-r--r--gdb/typeprint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/typeprint.c b/gdb/typeprint.c
index 9a125076a1..c098a3f426 100644
--- a/gdb/typeprint.c
+++ b/gdb/typeprint.c
@@ -489,6 +489,10 @@ whatis_exp (const char *exp, int show)
check_typedef (type);
if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF)
type = TYPE_TARGET_TYPE (type);
+
+ /* If the expression is actually a type, then there's no
+ value to fetch the dynamic type from. */
+ val = NULL;
}
else
{
@@ -506,7 +510,7 @@ whatis_exp (const char *exp, int show)
}
get_user_print_options (&opts);
- if (opts.objectprint)
+ if (val != NULL && opts.objectprint)
{
if (((TYPE_CODE (type) == TYPE_CODE_PTR) || TYPE_IS_REFERENCE (type))
&& (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))