*** empty log message ***
[deliverable/binutils-gdb.git] / gdb / cp-abi.c
index 9d5d60c671d251ca60980ffbaaf8e7762963a814..a499a86de87f06f28c6af6a1b22a22c75a82deba 100644 (file)
@@ -1,6 +1,6 @@
 /* Generic code for supporting multiple C++ ABI's
 
-   Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007
+   Copyright (C) 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -22,6 +22,7 @@
 #include "value.h"
 #include "cp-abi.h"
 #include "command.h"
+#include "exceptions.h"
 #include "gdbcmd.h"
 #include "ui-out.h"
 
@@ -89,9 +90,17 @@ value_virtual_fn_field (struct value **arg1p, struct fn_field *f, int j,
 struct type *
 value_rtti_type (struct value *v, int *full, int *top, int *using_enc)
 {
+  struct type *ret = NULL;
+  struct gdb_exception e;
   if ((current_cp_abi.rtti_type) == NULL)
     return NULL;
-  return (*current_cp_abi.rtti_type) (v, full, top, using_enc);
+  TRY_CATCH (e, RETURN_MASK_ERROR)
+    {
+      ret = (*current_cp_abi.rtti_type) (v, full, top, using_enc);
+    }
+  if (e.reason < 0)
+    return NULL;
+  return ret;
 }
 
 void
@@ -104,19 +113,20 @@ cplus_print_method_ptr (const gdb_byte *contents, struct type *type,
 }
 
 int
-cplus_method_ptr_size (void)
+cplus_method_ptr_size (struct type *to_type)
 {
   if (current_cp_abi.method_ptr_size == NULL)
     error (_("GDB does not support pointers to methods on this target"));
-  return (*current_cp_abi.method_ptr_size) ();
+  return (*current_cp_abi.method_ptr_size) (to_type);
 }
 
 void
-cplus_make_method_ptr (gdb_byte *contents, CORE_ADDR value, int is_virtual)
+cplus_make_method_ptr (struct type *type, gdb_byte *contents,
+                      CORE_ADDR value, int is_virtual)
 {
   if (current_cp_abi.make_method_ptr == NULL)
     error (_("GDB does not support pointers to methods on this target"));
-  (*current_cp_abi.make_method_ptr) (contents, value, is_virtual);
+  (*current_cp_abi.make_method_ptr) (type, contents, value, is_virtual);
 }
 
 CORE_ADDR
@@ -135,6 +145,14 @@ cplus_method_ptr_to_value (struct value **this_p, struct value *method_ptr)
   return (*current_cp_abi.method_ptr_to_value) (this_p, method_ptr);
 }
 
+int
+cp_pass_by_reference (struct type *type)
+{
+  if ((current_cp_abi.pass_by_reference) == NULL)
+    return 0;
+  return (*current_cp_abi.pass_by_reference) (type);
+}
+
 /* Set the current C++ ABI to SHORT_NAME.  */
 
 static int
@@ -185,10 +203,10 @@ set_cp_abi_as_auto_default (const char *short_name)
   auto_cp_abi = *abi;
 
   auto_cp_abi.shortname = "auto";
-  xasprintf (&new_longname, "currently \"%s\"", abi->shortname);
+  new_longname = xstrprintf ("currently \"%s\"", abi->shortname);
   auto_cp_abi.longname = new_longname;
 
-  xasprintf (&new_doc, "Automatically selected; currently \"%s\"",
+  new_doc = xstrprintf ("Automatically selected; currently \"%s\"",
             abi->shortname);
   auto_cp_abi.doc = new_doc;
 
This page took 0.029986 seconds and 4 git commands to generate.