daily update
[deliverable/binutils-gdb.git] / gdb / gnu-v2-abi.c
index 2405fb04eb827e1e994a210da1937a518e763d25..67bf097569f16b07cf275e36be935a995e2380a0 100644 (file)
@@ -1,6 +1,6 @@
 /* Abstraction of GNU v2 abi.
 
-   Copyright (C) 2001, 2002, 2003, 2005, 2007, 2008
+   Copyright (C) 2001, 2002, 2003, 2005, 2007, 2008, 2009, 2010
    Free Software Foundation, Inc.
 
    Contributed by Daniel Berlin <dberlin@redhat.com>
@@ -28,7 +28,6 @@
 #include "demangle.h"
 #include "cp-abi.h"
 #include "cp-support.h"
-#include "gnu-v2-abi.h"
 
 #include <ctype.h>
 
@@ -97,8 +96,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
   struct value *entry;
   struct value *vfn;
   struct value *vtbl;
-  struct value *vi = value_from_longest (builtin_type_int32,
-                                    (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j));
+  LONGEST vi = (LONGEST) TYPE_FN_FIELD_VOFFSET (f, j);
   struct type *fcontext = TYPE_FN_FIELD_FCONTEXT (f, j);
   struct type *context;
   struct type *context_vptr_basetype;
@@ -115,6 +113,7 @@ gnuv2_virtual_fn_field (struct value **arg1p, struct fn_field * f, int j,
   if (TYPE_TARGET_TYPE (context) != type1)
     {
       struct value *tmp = value_cast (context, value_addr (arg1));
+
       arg1 = value_ind (tmp);
       type1 = check_typedef (value_type (arg1));
     }
@@ -187,13 +186,8 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
 {
   struct type *known_type;
   struct type *rtti_type;
-  CORE_ADDR coreptr;
-  struct value *vp;
-  long top_offset = 0;
-  char rtti_type_name[256];
   CORE_ADDR vtbl;
   struct minimal_symbol *minsym;
-  struct symbol *sym;
   char *demangled_name, *p;
   struct type *btype;
   struct type *known_type_vptr_basetype;
@@ -242,7 +236,7 @@ gnuv2_value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
     we'd waste a bunch of time figuring out we already know the type.
     Besides, we don't care about the type, just the actual pointer
   */
-  if (VALUE_ADDRESS (value_field (v, known_type_vptr_fieldno)) == 0)
+  if (value_address (value_field (v, known_type_vptr_fieldno)) == 0)
     return NULL;
 
   vtbl = value_as_address (value_field (v, known_type_vptr_fieldno));
@@ -347,7 +341,7 @@ vb_match (struct type *type, int index, struct type *basetype)
 
    -1 is returned on error. */
 
-int
+static int
 gnuv2_baseclass_offset (struct type *type, int index,
                        const bfd_byte *valaddr, CORE_ADDR address)
 {
@@ -366,8 +360,8 @@ gnuv2_baseclass_offset (struct type *type, int index,
          if (vb_match (type, i, basetype))
            {
              CORE_ADDR addr
-             = unpack_pointer (TYPE_FIELD_TYPE (type, i),
-                               valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
+               = unpack_pointer (TYPE_FIELD_TYPE (type, i),
+                                 valaddr + (TYPE_FIELD_BITPOS (type, i) / 8));
 
              return addr - (LONGEST) address;
            }
@@ -376,7 +370,8 @@ gnuv2_baseclass_offset (struct type *type, int index,
       for (i = index + 1; i < n_baseclasses; i++)
        {
          int boffset =
-         baseclass_offset (type, i, valaddr, address);
+           baseclass_offset (type, i, valaddr, address);
+
          if (boffset)
            return boffset;
        }
This page took 0.028231 seconds and 4 git commands to generate.