Fix typo in gdb.python/py-objfile.exp
[deliverable/binutils-gdb.git] / gdb / gnu-v3-abi.c
index 6a96d21473e94015d73ca668f9975b9f1c5779f8..e233fe6b28de4e5aa02cef2f059f16648f7aa76f 100644 (file)
@@ -39,13 +39,13 @@ static struct gdbarch_data *std_type_info_gdbarch_data;
 static int
 gnuv3_is_vtable_name (const char *name)
 {
-  return strncmp (name, "_ZTV", 4) == 0;
+  return startswith (name, "_ZTV");
 }
 
 static int
 gnuv3_is_operator_name (const char *name)
 {
-  return strncmp (name, "operator", 8) == 0;
+  return startswith (name, "operator");
 }
 
 
@@ -202,7 +202,7 @@ gnuv3_dynamic_class (struct type *type)
 {
   int fieldnum, fieldelem;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
   gdb_assert (TYPE_CODE (type) == TYPE_CODE_STRUCT
              || TYPE_CODE (type) == TYPE_CODE_UNION);
 
@@ -253,7 +253,7 @@ gnuv3_get_vtable (struct gdbarch *gdbarch,
   struct value *vtable_pointer;
   CORE_ADDR vtable_address;
 
-  CHECK_TYPEDEF (container_type);
+  container_type = check_typedef (container_type);
   gdb_assert (TYPE_CODE (container_type) == TYPE_CODE_STRUCT);
 
   /* If this type does not have a virtual table, don't read the first
@@ -330,7 +330,7 @@ gnuv3_rtti_type (struct value *value,
      should work just as well, and doesn't read target memory.  */
   vtable_symbol_name = MSYMBOL_DEMANGLED_NAME (vtable_symbol);
   if (vtable_symbol_name == NULL
-      || strncmp (vtable_symbol_name, "vtable for ", 11))
+      || !startswith (vtable_symbol_name, "vtable for "))
     {
       warning (_("can't find linker symbol for virtual table for `%s' value"),
               TYPE_SAFE_NAME (values_type));
@@ -904,8 +904,8 @@ print_one_vtable (struct gdbarch *gdbarch, struct value *value,
     {
       /* Initialize it just to avoid a GCC false warning.  */
       CORE_ADDR addr = 0;
+      int got_error = 0;
       struct value *vfn;
-      volatile struct gdb_exception ex;
 
       printf_filtered ("[%d]: ", i);
 
@@ -916,13 +916,18 @@ print_one_vtable (struct gdbarch *gdbarch, struct value *value,
       if (gdbarch_vtable_function_descriptors (gdbarch))
        vfn = value_addr (vfn);
 
-      TRY_CATCH (ex, RETURN_MASK_ERROR)
+      TRY
        {
          addr = value_as_address (vfn);
        }
-      if (ex.reason < 0)
-       printf_filtered (_("<error: %s>"), ex.message);
-      else
+      CATCH (ex, RETURN_MASK_ERROR)
+       {
+         printf_filtered (_("<error: %s>"), ex.message);
+         got_error = 1;
+       }
+      END_CATCH
+
+      if (!got_error)
        print_function_pointer_address (opts, gdbarch, addr, gdb_stdout);
       printf_filtered ("\n");
     }
@@ -1288,7 +1293,7 @@ gnuv3_pass_by_reference (struct type *type)
 {
   int fieldnum, fieldelem;
 
-  CHECK_TYPEDEF (type);
+  type = check_typedef (type);
 
   /* We're only interested in things that can have methods.  */
   if (TYPE_CODE (type) != TYPE_CODE_STRUCT
This page took 0.024482 seconds and 4 git commands to generate.