*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / cp-valprint.c
index b2bb58727dc0efa7a038da191444505b773977f7..4d9131921adab7577c253c0d6e4d6dc4fa6e06d8 100644 (file)
@@ -1,7 +1,8 @@
 /* Support for printing C++ values for GDB, the GNU debugger.
 
    Copyright (C) 1986, 1988, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
-   2000, 2001, 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc.
+   2000, 2001, 2002, 2003, 2005, 2006, 2007, 2008
+   Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -267,7 +268,8 @@ cp_print_value_fields (struct type *type, struct type *real_type,
                    (TYPE_FIELD_TYPE (type, i), 
                     unpack_field_as_long (type, valaddr + offset, i));
 
-                 common_val_print (v, stream, format, 0, recurse + 1, pretty);
+                 common_val_print (v, stream, format, 0, recurse + 1, pretty,
+                                   current_language);
                }
            }
          else
@@ -291,7 +293,8 @@ cp_print_value_fields (struct type *type, struct type *real_type,
                  val_print (TYPE_FIELD_TYPE (type, i),
                             valaddr, offset + TYPE_FIELD_BITPOS (type, i) / 8,
                             address + TYPE_FIELD_BITPOS (type, i) / 8,
-                            stream, format, 0, recurse + 1, pretty);
+                            stream, format, 0, recurse + 1, pretty,
+                            current_language);
                }
            }
          annotate_field_end ();
@@ -485,7 +488,7 @@ cp_print_static_field (struct type *type,
     }
   val_print (type, value_contents_all (val), 
             value_embedded_offset (val), VALUE_ADDRESS (val),
-            stream, format, 0, recurse, pretty);
+            stream, format, 0, recurse, pretty, current_language);
 }
 
 
@@ -535,16 +538,16 @@ cp_find_class_member (struct type **domain_p, int *fieldno,
 }
 
 void
-cp_print_class_member (const gdb_byte *valaddr, struct type *domain,
+cp_print_class_member (const gdb_byte *valaddr, struct type *type,
                       struct ui_file *stream, char *prefix)
 {
   /* VAL is a byte offset into the structure type DOMAIN.
      Find the name of the field for that offset and
      print it.  */
+  struct type *domain = TYPE_DOMAIN_TYPE (type);
+  LONGEST val = extract_signed_integer (valaddr, TYPE_LENGTH (type));
   unsigned int fieldno;
 
-  LONGEST val = unpack_long (builtin_type_long, valaddr);
-
   /* Pointers to data members are usually byte offsets into an object.
      Because a data member can have offset zero, and a NULL pointer to
      member must be distinct from any valid non-NULL pointer to
This page took 0.023707 seconds and 4 git commands to generate.