aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
authorDaniel Berlin <dberlin@dberlin.org>2000-04-04 04:53:50 +0000
committerDaniel Berlin <dberlin@dberlin.org>2000-04-04 04:53:50 +0000
commit070ad9f02e4caeb3ee1aae1b8d62310ebb9e00d6 (patch)
tree218c4452a2270e4dd8aeca544d4cd82a26013456 /gdb/c-valprint.c
parenteb90a51f9d4756c52f40cf2f4b906e1f6abc646b (diff)
downloadfsf-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/c-valprint.c')
-rw-r--r--gdb/c-valprint.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 07289de..ec4b3cf 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -481,6 +481,17 @@ c_value_print (val, stream, format, pretty)
}
else if (objectprint && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_CLASS))
{
+
+ if (TYPE_CODE(type) == TYPE_CODE_REF)
+ {
+ /* Copy value, change to pointer, so we don't get an
+ * error about a non-pointer type in value_rtti_target_type
+ */
+ value_ptr temparg;
+ temparg=value_copy(val);
+ VALUE_TYPE (temparg) = lookup_pointer_type(TYPE_TARGET_TYPE(type));
+ val=temparg;
+ }
/* Pointer to class, check real type of object */
fprintf_filtered (stream, "(");
real_type = value_rtti_target_type (val, &full, &top, &using_enc);
@@ -497,6 +508,9 @@ c_value_print (val, stream, format, pretty)
/* create a reference type referencing the real type */
type = lookup_reference_type (real_type);
}
+ /* JYG: Need to adjust pointer value. */
+ val->aligner.contents[0] -= top;
+
/* Note: When we look up RTTI entries, we don't get any
information on const or volatile attributes */
}