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.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index c9109f0..c094a17 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -441,8 +441,12 @@ c_val_print (struct type *type, char *valaddr, int embedded_offset,
break;
case TYPE_CODE_METHOD:
- cp_print_class_method (valaddr + embedded_offset, lookup_pointer_type (type), stream);
- break;
+ {
+ struct value *v = value_at (type, address, NULL);
+ cp_print_class_method (VALUE_CONTENTS (value_addr (v)),
+ lookup_pointer_type (type), stream);
+ break;
+ }
case TYPE_CODE_VOID:
fprintf_filtered (stream, "void");