2003-08-04 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / gnu-v3-abi.c
index 4df4dc6ee1cfc1d98ce991838716b57847b6a805..d9947f9f87da70c837f5b4a7b40fdb1ef59f4dbe 100644 (file)
@@ -25,6 +25,7 @@
 #include "cp-abi.h"
 #include "demangle.h"
 #include "gdb_assert.h"
+#include "gdb_string.h"
 
 static struct cp_abi_ops gnu_v3_abi_ops;
 
@@ -254,7 +255,7 @@ gnuv3_rtti_type (struct value *value,
   class_name = vtable_symbol_name + 11;
 
   /* Try to look up the class name as a type name.  */
-  class_symbol = lookup_symbol (class_name, 0, STRUCT_NAMESPACE, 0, 0);
+  class_symbol = lookup_symbol (class_name, 0, STRUCT_DOMAIN, 0, 0);
   if (! class_symbol)
     {
       warning ("can't find class named `%s', as given by C++ RTTI", class_name);
@@ -323,6 +324,9 @@ gnuv3_virtual_fn_field (struct value **value_p,
      type now.  */
   if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
     fill_in_vptr_fieldno (vfn_base);
+  if (TYPE_VPTR_FIELDNO (vfn_base) < 0)
+    error ("Could not find virtual table pointer for class \"%s\".",
+          TYPE_TAG_NAME (vfn_base) ? TYPE_TAG_NAME (vfn_base) : "<unknown>");
 
   /* Now that we know which base class is defining our virtual
      function, cast our value to that baseclass.  This takes care of
@@ -368,7 +372,7 @@ gnuv3_virtual_fn_field (struct value **value_p,
    to (the address of)(ARG) + OFFSET.
 
    -1 is returned on error. */
-int
+static int
 gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
                        CORE_ADDR address)
 {
@@ -429,7 +433,7 @@ gnuv3_baseclass_offset (struct type *type, int index, char *valaddr,
 static void
 init_gnuv3_ops (void)
 {
-  vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type, 0);
+  vtable_type_gdbarch_data = register_gdbarch_data (build_gdb_vtable_type);
 
   gnu_v3_abi_ops.shortname = "gnu-v3";
   gnu_v3_abi_ops.longname = "GNU G++ Version 3 ABI";
@@ -443,11 +447,12 @@ init_gnuv3_ops (void)
   gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset;
 }
 
+extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */
 
 void
 _initialize_gnu_v3_abi (void)
 {
   init_gnuv3_ops ();
 
-  register_cp_abi (gnu_v3_abi_ops);
+  register_cp_abi (&gnu_v3_abi_ops);
 }
This page took 0.023794 seconds and 4 git commands to generate.