aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKung Hsu <kung@cygnus>1993-09-29 17:02:10 +0000
committerKung Hsu <kung@cygnus>1993-09-29 17:02:10 +0000
commit1bd97ba80a3adb42650e5d30b67b36964ca62d94 (patch)
tree15228dc4195acf44807cb59ec8b58aa56ffafb0b
parent182ecac5b973a39a857b68684942e14f899d43ff (diff)
downloadgdb-1bd97ba80a3adb42650e5d30b67b36964ca62d94.zip
gdb-1bd97ba80a3adb42650e5d30b67b36964ca62d94.tar.gz
gdb-1bd97ba80a3adb42650e5d30b67b36964ca62d94.tar.bz2
Modified Files:
c-valprint.c Log messages: * c-valprint.c: to fix virtual table print bug (pr2695)
-rw-r--r--gdb/c-valprint.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
index 2d5a826..bcf0a28 100644
--- a/gdb/c-valprint.c
+++ b/gdb/c-valprint.c
@@ -200,8 +200,25 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
if (vtblprint)
{
value vt_val;
+ struct symbol *wsym = (struct symbol *)NULL;
+ struct type *wtype;
+ struct symtab *s;
+ struct block *block = (struct block *)NULL;
+ int is_this_fld;
- vt_val = value_at (TYPE_TARGET_TYPE (type), vt_address);
+
+ wsym = lookup_symbol (SYMBOL_NAME(msymbol), block,
+ VAR_NAMESPACE, &is_this_fld, &s);
+
+ if (wsym)
+ {
+ wtype = SYMBOL_TYPE(wsym);
+ }
+ else
+ {
+ wtype = TYPE_TARGET_TYPE(type);
+ }
+ vt_val = value_at (wtype, vt_address);
val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
VALUE_ADDRESS (vt_val), stream, format,
deref_ref, recurse + 1, pretty);