diff --git a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj index 5290a6bc8c57f8..9f49d928728f5a 100644 --- a/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj +++ b/src/mono/System.Private.CoreLib/System.Private.CoreLib.csproj @@ -152,6 +152,8 @@ + + diff --git a/src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml b/src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml index eac1bad9a0b2aa..b6f25f011cfc9f 100644 --- a/src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml +++ b/src/mono/System.Private.CoreLib/src/ILLink/ILLink.Descriptors.xml @@ -633,6 +633,14 @@ + + + + + + + + diff --git a/src/mono/System.Private.CoreLib/src/System/AppContext.Mono.cs b/src/mono/System.Private.CoreLib/src/System/AppContext.Mono.cs new file mode 100644 index 00000000000000..177df1c65b1093 --- /dev/null +++ b/src/mono/System.Private.CoreLib/src/System/AppContext.Mono.cs @@ -0,0 +1,14 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + public static partial class AppContext + { + internal static void DoUnhandledException (object sender, UnhandledExceptionEventArgs args) + { + if (UnhandledException != null) + UnhandledException (sender, args); + } + } +} diff --git a/src/mono/System.Private.CoreLib/src/System/AppDomain.Mono.cs b/src/mono/System.Private.CoreLib/src/System/AppDomain.Mono.cs new file mode 100644 index 00000000000000..41a4bc62c37c46 --- /dev/null +++ b/src/mono/System.Private.CoreLib/src/System/AppDomain.Mono.cs @@ -0,0 +1,15 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace System +{ + public partial class AppDomain + { +#if TARGET_ANDROID + internal void DoUnhandledException (UnhandledExceptionEventArgs args) + { + AppContext.DoUnhandledException (this, args); + } +#endif + } +} diff --git a/src/mono/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs b/src/mono/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs index 6d3593b6e05e43..2a0057814ff80a 100644 --- a/src/mono/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs +++ b/src/mono/System.Private.CoreLib/src/System/Diagnostics/Debugger.cs @@ -41,5 +41,15 @@ public static void Log(int level, string? category, string? message) public static void NotifyOfCrossThreadDependency() { } + +#if TARGET_ANDROID + [MethodImplAttribute (MethodImplOptions.InternalCall)] + private static extern void Mono_UnhandledException_internal (Exception ex); + + internal static void Mono_UnhandledException (Exception ex) + { + Mono_UnhandledException_internal (ex); + } +#endif } }