aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-valprint.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/c-valprint.c')
-rw-r--r--gdb/c-valprint.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 76579d2..3461b08 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -380,10 +380,19 @@ c_val_print (struct type *type, const gdb_byte *valaddr,
{
if (TYPE_CODE (elttype) != TYPE_CODE_UNDEF)
{
- struct value *deref_val =
- value_at
- (TYPE_TARGET_TYPE (type),
- unpack_pointer (type, valaddr + embedded_offset));
+ struct value *deref_val;
+
+ deref_val = coerce_ref_if_computed (original_value);
+ if (deref_val != NULL)
+ {
+ /* More complicated computed references are not supported. */
+ gdb_assert (embedded_offset == 0);
+ }
+ else
+ deref_val = value_at (TYPE_TARGET_TYPE (type),
+ unpack_pointer (type,
+ (valaddr
+ + embedded_offset)));
common_val_print (deref_val, stream, recurse, options,
current_language);