> * gdb.texinfo (hbreak, watch): Fix typo, "date" -> "data".
[deliverable/binutils-gdb.git] / gdb / c-valprint.c
index 20dae22f2a7bc8c666c4a7bbfadb796c7840a8b3..ee620dca856d238091dfcf7cb7c36088149f843f 100644 (file)
@@ -1,5 +1,5 @@
 /* Support for printing C values for GDB, the GNU debugger.
-   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995
+   Copyright 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997
              Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -211,7 +211,7 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
                    {
                      wtype = TYPE_TARGET_TYPE(type);
                    }
-                 vt_val = value_at (wtype, vt_address);
+                 vt_val = value_at (wtype, vt_address, NULL);
                  val_print (VALUE_TYPE (vt_val), VALUE_CONTENTS (vt_val),
                             VALUE_ADDRESS (vt_val), stream, format,
                             deref_ref, recurse + 1, pretty);
@@ -261,7 +261,8 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
                value_at
                  (TYPE_TARGET_TYPE (type),
                   unpack_pointer (lookup_pointer_type (builtin_type_void),
-                                  valaddr));
+                                  valaddr),
+                  NULL);
              val_print (VALUE_TYPE (deref_val),
                         VALUE_CONTENTS (deref_val),
                         VALUE_ADDRESS (deref_val), stream, format,
@@ -285,9 +286,10 @@ c_val_print (type, valaddr, address, stream, format, deref_ref, recurse,
           /* Print the unmangled name if desired.  */
          /* Print vtable entry - we only get here if NOT using
             -fvtable_thunks.  (Otherwise, look under TYPE_CODE_PTR.) */
-         print_address_demangle(*((int *) (valaddr +   /* FIXME bytesex */
-             TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8)),
-             stream, demangle);
+          print_address_demangle (extract_address (
+               valaddr + TYPE_FIELD_BITPOS (type, VTBL_FNADDR_OFFSET) / 8,
+               TYPE_LENGTH (TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET))),
+              stream, demangle);
        }
       else
        cp_print_value_fields (type, valaddr, address, stream, format,
@@ -465,6 +467,7 @@ c_value_print (val, stream, format, pretty)
          fprintf_filtered (stream, ") ");
        }
     }
-  return (val_print (type, VALUE_CONTENTS (val),
-                    VALUE_ADDRESS (val), stream, format, 1, 0, pretty));
+  return val_print (type, VALUE_CONTENTS (val),
+                   VALUE_ADDRESS (val) + VALUE_OFFSET (val),
+                   stream, format, 1, 0, pretty);
 }
This page took 0.024062 seconds and 4 git commands to generate.