Introduce SgenObjectOperations that holds all copy/scan functions needed by a given...
[mono.git] / mono / metadata / exception.c
index 26f4f40f905478793954279ab474f7b4bf56bae8..ee10668e20d247ff82d058cafc5dc8690204c455 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <mono/metadata/exception.h>
 #include <mono/metadata/object-internals.h>
+#include <mono/metadata/metadata-internals.h>
 #include <mono/metadata/appdomain.h>
 #include <string.h>
 
@@ -683,6 +684,18 @@ mono_get_exception_field_access (void)
        return mono_exception_from_name (mono_get_corlib (), "System", "FieldAccessException");
 }
 
+/**
+ * mono_get_exception_field_access2:
+ * @msg: an informative message for the user.
+ *
+ * Returns: a new instance of the System.FieldAccessException
+ */
+MonoException *
+mono_get_exception_field_access_msg (const char *msg)
+{
+       return mono_exception_from_name_msg (mono_get_corlib (), "System", "FieldAccessException", msg);
+}
+
 /**
  * mono_get_exception_method_access:
  *
@@ -694,6 +707,18 @@ mono_get_exception_method_access (void)
        return mono_exception_from_name (mono_get_corlib (), "System", "MethodAccessException");
 }
 
+/**
+ * mono_get_exception_method_access2:
+ * @msg: an informative message for the user.
+ *
+ * Returns: a new instance of the System.MethodAccessException
+ */
+MonoException *
+mono_get_exception_method_access_msg (const char *msg)
+{
+       return mono_exception_from_name_msg (mono_get_corlib (), "System", "MethodAccessException", msg);
+}
+
 /**
  * mono_get_exception_reflection_type_load:
  * @types: an array of types that were defined in the moduled loaded.
@@ -724,3 +749,14 @@ mono_get_exception_reflection_type_load (MonoArray *types, MonoArray *exceptions
 
        return (MonoException *) exc;
 }
+
+MonoException *
+mono_get_exception_runtime_wrapped (MonoObject *wrapped_exception)
+{
+       MonoRuntimeWrappedException *ex = (MonoRuntimeWrappedException*)
+               mono_exception_from_name (mono_get_corlib (), "System.Runtime.CompilerServices",
+                                                                 "RuntimeWrappedException");
+
+   MONO_OBJECT_SETREF (ex, wrapped_exception, wrapped_exception);
+   return (MonoException*)ex;
+}