Add Mono.Runtime::GetNativeStackTrace method to make the new backtracing facility...
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 20 Jul 2012 16:20:16 +0000 (13:20 -0300)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 20 Jul 2012 16:23:28 +0000 (13:23 -0300)
mcs/class/corlib/Mono/Runtime.cs
mono/metadata/exception.c
mono/metadata/icall-def.h
mono/metadata/object-internals.h

index 9636fb1bda3ad123e3c4b73a611db16564ae8b25..b036daba679dddb14a94bdb347b15cd51f5cd73a 100644 (file)
@@ -47,6 +47,10 @@ namespace Mono {
                // Format is undefined only for use as a string for reporting
                [MethodImplAttribute (MethodImplOptions.InternalCall)]
                internal static extern string GetDisplayName ();
+
+               [MethodImplAttribute (MethodImplOptions.InternalCall)]
+               public static extern string GetNativeStackTrace (Exception exception);
+
        }
        
 }
index e3ba90d69d77acec5f6198c6e0f490b582088828..f120041e2d255cd8eb735b76f8cd803add86a46f 100644 (file)
@@ -803,3 +803,16 @@ mono_exception_get_native_backtrace (MonoException *exc)
 #endif
 }
 
+MonoString *
+ves_icall_Mono_Runtime_GetNativeStackTrace (MonoException *exc)
+{
+       char *trace;
+       MonoString *res;
+       if (!exc)
+               mono_raise_exception (mono_get_exception_argument_null ("exception"));
+
+       trace = mono_exception_get_native_backtrace (exc);
+       res = mono_string_new (mono_domain_get (), trace);
+       g_free (trace);
+       return res;
+}
index 3939a9a2f258d099e9199368671648097ae4d315..b4667d71f4689788b30ef8f4ba373630d2a79aa4 100644 (file)
@@ -47,6 +47,7 @@ ICALL(COMPROX_2, "FindProxy", ves_icall_Mono_Interop_ComInteropProxy_FindProxy)
 
 ICALL_TYPE(RUNTIME, "Mono.Runtime", RUNTIME_1)
 ICALL(RUNTIME_1, "GetDisplayName", ves_icall_Mono_Runtime_GetDisplayName)
+ICALL(RUNTIME_12, "GetNativeStackTrace", ves_icall_Mono_Runtime_GetNativeStackTrace)
 
 #ifndef PLATFORM_RO_FS
 ICALL_TYPE(KPAIR, "Mono.Security.Cryptography.KeyPairPersistence", KPAIR_1)
index 0f8981c8c7958a9bfd5b0429ad1fafda9497a485..3a455158cd5821fd152e917c532869885968c7ee 100644 (file)
@@ -1577,6 +1577,9 @@ mono_monitor_is_il_fastpath_wrapper (MonoMethod *method) MONO_INTERNAL;
 char *
 mono_exception_get_native_backtrace (MonoException *exc) MONO_INTERNAL;
 
+MonoString *
+ves_icall_Mono_Runtime_GetNativeStackTrace (MonoException *exc) MONO_INTERNAL;
+
 #endif /* __MONO_OBJECT_INTERNALS_H__ */