diff options
author | Daniel Berlin <dberlin@dberlin.org> | 2000-04-04 04:53:50 +0000 |
---|---|---|
committer | Daniel Berlin <dberlin@dberlin.org> | 2000-04-04 04:53:50 +0000 |
commit | 070ad9f02e4caeb3ee1aae1b8d62310ebb9e00d6 (patch) | |
tree | 218c4452a2270e4dd8aeca544d4cd82a26013456 /gdb/typeprint.c | |
parent | eb90a51f9d4756c52f40cf2f4b906e1f6abc646b (diff) | |
download | fsf-binutils-gdb-070ad9f02e4caeb3ee1aae1b8d62310ebb9e00d6.zip fsf-binutils-gdb-070ad9f02e4caeb3ee1aae1b8d62310ebb9e00d6.tar.gz fsf-binutils-gdb-070ad9f02e4caeb3ee1aae1b8d62310ebb9e00d6.tar.bz2 |
C++ changes for 5.0, finally committed.
Diffstat (limited to 'gdb/typeprint.c')
-rw-r--r-- | gdb/typeprint.c | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 560c4a1..5b46cba 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -82,6 +82,7 @@ whatis_exp (exp, show) register value_ptr val; register struct cleanup *old_chain = NULL; struct type *real_type = NULL; + struct type *type; int full = 0; int top = -1; int using_enc = 0; @@ -96,17 +97,40 @@ whatis_exp (exp, show) else val = access_value_history (0); + type = VALUE_TYPE (val); + + if (objectprint) + { + if (((TYPE_CODE (type) == TYPE_CODE_PTR) || + (TYPE_CODE (type) == TYPE_CODE_REF)) + && + (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS)) + { + real_type = value_rtti_target_type (val, &full, &top, &using_enc); + if (real_type) + { + if (TYPE_CODE (type) == TYPE_CODE_PTR) + real_type = lookup_pointer_type (real_type); + else + real_type = lookup_reference_type (real_type); + } + } + else if (TYPE_CODE (type) == TYPE_CODE_CLASS) real_type = value_rtti_type (val, &full, &top, &using_enc); + } printf_filtered ("type = "); - if (real_type && objectprint) - printf_filtered ("/* real type = %s%s */\n", - TYPE_NAME (real_type), - full ? "" : " (incomplete object)"); - /* FIXME: maybe better to use type_print (real_type, "", gdb_stdout, -1); */ + if (real_type) + { + printf_filtered ("/* real type = "); + type_print (real_type, "", gdb_stdout, -1); + if (! full) + printf_filtered (" (incomplete object)"); + printf_filtered (" */\n"); + } - type_print (VALUE_TYPE (val), "", gdb_stdout, show); + type_print (type, "", gdb_stdout, show); printf_filtered ("\n"); if (exp) |