Граф коммитов

325 Коммитов

Автор SHA1 Сообщение Дата
Rolf Bjarne Kvinge 8b0f3c80d8 [registrar] Create a xamarin_string_to_nsstring function to avoid code duplication. 2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge 10d7d1c26f [runtime] Use a 'void*' for the context in conversion functions instead of 'guint32'.
No function changes, just a refactoring to allow for pointers as context.
2019-04-30 14:29:24 +00:00
Rolf Bjarne Kvinge 0f9c122800 [runtime] Add new functions to the header so that they don't use C++ mangling.
Fixes these test failures:

    2) Failed : Xamarin.Tests.Misc.PublicSymbols(iOS)
      Failed libraries
      Expected: <empty>
      But was:  "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libxamarin-debug.a:
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj"

    3) Failed : Xamarin.Tests.Misc.PublicSymbols(tvOS)
      Failed libraries
      Expected: <empty>
      But was:  "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj"

    4) Failed : Xamarin.Tests.Misc.PublicSymbols(watchOS)
      Failed libraries
      Expected: <empty>
      But was:  "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj"

    5) Failed : Xamarin.Tests.Misc.PublicSymbols(macOSMobile)
      Failed libraries
      Expected: <empty>
      But was:  "/Users/builder/jenkins/workspace/xamarin-macios-pr-builder/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-system-debug.a:
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_nsobject_to_objectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z26xamarin_object_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_inativeobject_to_nsobjectP10MonoObjectPvPj
    	__Z33xamarin_nsobject_to_inativeobjectP11objc_objectPvP10_MonoClassS1_Pj
    	__Z40xamarin_nsobject_to_inativeobject_staticP11objc_objectPvP10_MonoClassS1_Pj"
2019-04-29 15:04:07 +02:00
Rolf Bjarne Kvinge 6e9afbc605 [registrar] Add support for ref/out arrays. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 87a5b2dac8 [registrar] Fix support for ref string parameters. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge af38ac286c [registrar] Fix/implement returning SEL/Class in a ref/out parameter in the registrars. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 1f7cdecd3d [registrar] Reuse some more array conversion code from the static registrar. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 4a82341c91 [runtime] Add support for value types to xamarin_convert_managed_to_nsarray_with_func/xamarin_convert_nsarray_to_managed_with_func. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 7a9cb8372a [registrar] Extract code to create a managed array from an NSArray to a separate method. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 4f3b6115fc [registrar] Extract code to create an NSArray from a managed array to a separate method. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge f83df952de [runtime] Report which element failed to convert when marshalling an array between Objective-C and managed code. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge ae879324a6 [registrar] Some more simplification. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 02d2dfc60e [registrar] Don't let a failure to copy back a parameter go unnoticed.
Now that we ignore parameters we're not copying back, we can throw an
exception if we run into a parameter we don't know how to copy back.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 5871040bb3 [registrar] Simplify code a bit and reduce indentation.
Best reviewed by ignoring whitespace.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge e80f4d5dca [registrar] Simplify copyback loop a little bit.
Simplify by having a single loop variable, and remove the usage of the
other ('ofs'), since it's not needed.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge a3278ff178 [registrar] Improve writeback logic for out/ref parameters.
* Keep track of which parameters needs to be written back. This makes sure the
  writeback loop doesn't run into non-writeback-parameters it doesn't know how
  to handle (by skipping them completely).

* Keep track of the (post-marshal) input to the out/ref parameters, so that we
  know whether we need to marshal anything back in the writeback loop.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 9b60eebaef [registrar] Fix multiple ref/out parameters for a single method.
The previous code would break the loop looking for ref/out parameters after finding the first one.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge ad4cc04af9 [registrar] Refactor to reduce indentation a bit.
Best viewed by ignoring whitespace.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 509c5be093 [registrar] Create a xamarin_nsstring_to_string to avoid code duplication. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge 2b5229fe46 [registrar] Create a xamarin_string_to_nsstring function to avoid code duplication. 2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge fc6b2c0a0d [runtime] Use a 'void*' for the context in conversion functions instead of 'guint32'.
No function changes, just a refactoring to allow for pointers as context.
2019-04-26 11:20:15 +02:00
Rolf Bjarne Kvinge c8ed014af7
[runtime] Improve exception creation. (#5944)
* [runtime] Add an inner exception parameter to Runtime.CreateProductException.

This allows us to simplify code by using inner (and outer) exceptions as
a means to provide information instead of passing extra information
around in order to create decent exceptions.

One example is how we pass the selector and method name to the method
that converts from a native id to a managed NSObject instance: passing
this information is not necessary anymore if we can use two exceptions,
one for the failure to convert from an id to a NSObject instance,
wrapped in a second that tells which method/selector call ran into this
conversion problem.

* [runtime] Throw better exceptions when the dynamic registrar can't marshal something.

* [runtime] Throw a better exception when something goes wrong when trying to marshal a return value.

* [runtime] Use inner exceptions to convey failure information instead of trying to create a single exception with all we know.

* Fix merge problem.
2019-04-26 11:16:23 +02:00
Alexander Köplinger 7f717f01ae
Merge pull request #5563 from xamarin/mono-2019-02
Bump to mono:2019-02
2019-04-25 19:24:35 +02:00
Rolf Bjarne Kvinge aa4eaf7c92
Make a copy of the static registrar and the runtime headers for Xamarin.Mac/Classic. (#5945)
* [registrar] Make a copy of the static registrar for Xamarin.Mac/Classic.

Make a copy of the static registrar for Xamarin.Mac/Classic, one which is
compatible with the binary artifacts we ship for Xamarin.Mac/Classic
(libxammac, XamMac.dll).

This way the static registrar can evolve in the future, without breaking
Xamarin.Mac/Classic.

* [runtime] Make a copy of the runtime headers too.

* Update comment.

* [mmp] Delay creating a Target instance until we know if we're a Classic or Unified app.

Otherwise the wrong static registrar might be created.
2019-04-25 18:08:10 +02:00
Alexander Köplinger 99ea097abf Merge remote-tracking branch 'upstream/master' into mono-2019-02 2019-04-24 23:28:00 +02:00
Rolf Bjarne Kvinge df85569d23
[runtime] Rename CallState to XamarinCallState to keep the public namespace cleaner. (#5940)
Also ignore the corresponding public symbols in the PublicSymbols test.

This was introduced in 464882d14a (changes to
the CallState struct made the compiler create public symbols).

Fixes these test failures:

    1) Failed : Xamarin.Tests.Misc.PublicSymbols(iOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphoneos.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/MonoTouch.iphonesimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    2) Failed : Xamarin.Tests.Misc.PublicSymbols(tvOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVOS.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.AppleTVSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    3) Failed : Xamarin.Tests.Misc.PublicSymbols(watchOS)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchOS.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/git/SDKs/Xamarin.WatchSimulator.sdk/usr/lib/libxamarin-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196

    4) Failed : Xamarin.Tests.Misc.PublicSymbols(macOSMobile)
      Failed libraries
      Expected: <empty>
      But was:  "/work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-system-debug.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac-system.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    /work/maccore/master/xamarin-macios/_mac-build/Library/Frameworks/Xamarin.Mac.framework/Versions/Current/lib/libxammac.a:
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    	__ZN9CallState3selEv
    	__ZN9CallState4selfEv
    	__ZN9CallState8is_stretEv
    "
      at Xamarin.Tests.Misc.PublicSymbols (Xamarin.Tests.Profile profile) [0x00259] in /work/maccore/master/xamarin-macios/tests/mtouch/MiscTests.cs:196
2019-04-23 16:53:35 +01:00
Rolf Bjarne Kvinge 37a4db8335
[registrar] Use the right method to get INativeObject handles. (#5935) 2019-04-23 14:10:51 +01:00
Rolf Bjarne Kvinge 3e75c76d89
[runtime] Get the domain at the top of xamarin_invoke_trampoline. (#5925)
This avoids calling it multiple times in a loop further down in the method.
2019-04-23 06:30:46 +01:00
Rolf Bjarne Kvinge 464882d14a
[runtime] Refactor a little bit to avoid code duplication. (#5924) 2019-04-23 06:29:20 +01:00
Chris Hamons 2278512aba [launcher] Pass --use-map-jit to mono on XM app startup
- Related: https://github.com/mono/mono/pull/13446
    - Patch by Miguel
2019-04-12 18:06:28 +02:00
Rolf Bjarne Kvinge 8792992b79
[registrar] Make Runtime.GetINativeObject_Static take token references instead of type names. (#5879)
Saves some space in the executable by using 32-bit sized integers instead of much longer strings.
2019-04-09 16:47:33 +02:00
Vincent Dondain 86d1b42ad2 Merge branch 'xcode10.2' into master-merge-xcode10.2 2019-04-03 13:57:31 -04:00
Rolf Bjarne Kvinge 18b13ac876
[runtime] Use mono_array_setref instead of mono_array_set. (#5782)
* [Foundation] Add an NSArray.FromNSObjects overload that can take an array of INativeObjects.

* [runtime] Use mono_array_setref instead of mono_array_set.

Otherwise the GC won't know about the assignment, and the assigned value can
be freed if it's no longer referenced anywhere else.
2019-03-18 15:00:32 +01:00
Alexander Köplinger c4052955a8 Remove zlib-helper from runtime/
It is now built as part of mono: 5187b0bdaa
2019-02-05 01:46:02 +01:00
Alex Soto fbe591a998
[MetalPerformanceShaders] Apply feedback to Part 1 2019-01-29 15:37:49 -05:00
Alex Soto 3e0bcf2b32
[MetalPerformanceShaders] Update bindings from Xcode 9.2 to 10.2 - Part 1 of 2
Fixes: xamarin/xamarin-macios#5362

This includes updates for:

* MetalPerformanceShaders.framework
* MPSCore.framework
* MPSImage.framework
* MPSMatrix.framework
* MPSRayIntersector.framework

Pending:

* MPSNeuralNetwork.framework
2019-01-29 15:37:49 -05:00
Rolf Bjarne Kvinge 7f4a1db36f
[runtime] Use a single mono profiler for both newrefcount and NSAutoreleasePool thread hooks. (#5495)
Additionally don't use malloc'ed memory, to avoid having to free the memory.

This fixes a leak, since mono does not free the MonoProfiler argument:

    STACK OF 1 INSTANCE OF 'ROOT LEAK: <0x7fb94495c460>':
    [thread 0x10f3f85c0]:
    19  libdyld.dylib                      0x7fff6e009ed9 start + 1
    18  NameNotImportant                      0x10592dec4 main + 36  launcher.m:679
    17  NameNotImportant                      0x10592d039 xamarin_main + 1305  launcher.m:661
    16  NameNotImportant                      0x105973473 mono_main + 11731  driver.g.c:2484
    15  NameNotImportant                      0x10597020d mono_jit_exec + 349  driver.g.c:1236
    14  NameNotImportant                      0x105b4217e mono_runtime_exec_main_checked + 110  object.c:0
    13  NameNotImportant                      0x105b3af28 mono_runtime_invoke_checked + 136  object.c:2960
    12  NameNotImportant                      0x105a143a1 mono_jit_runtime_invoke + 513  mini-runtime.c:3011
    11  NameNotImportant                      0x105a103c1 mono_jit_compile_method_with_opt + 2577  mini-runtime.c:2411
    10  NameNotImportant                      0x105a21aa7 mono_jit_compile_method_inner + 1207  mini.c:4184
    9   NameNotImportant                      0x105b3b75f mono_runtime_class_init_full + 847  object.c:527
    8   NameNotImportant                      0x105b3c9d4 mono_runtime_try_invoke + 148  object.c:2960
    7   NameNotImportant                      0x105a147d3 mono_jit_runtime_invoke + 1587  mini-runtime.c:3148
    6   ???                                   0x106d00fb0 0x7fffffffffffffff + 9223372041264041905
    5   NameNotImportant                      0x105921b0c xamarin_initialize + 812  runtime.m:1412
    4   NameNotImportant                      0x10591e7e7 xamarin_install_nsautoreleasepool_hooks + 55  shared.m:241
    3   NameNotImportant                      0x105b4fd0a mono_profiler_install + 26  profiler.c:1019
    2   NameNotImportant                      0x105c3127b monoeg_malloc0 + 27  gmem.c:121
    1   libsystem_malloc.dylib             0x7fff6e1bacba calloc + 30
    0   libsystem_malloc.dylib             0x7fff6e1bad62 malloc_zone_calloc + 139

Also remove the call to mono_profiler_set_events, it doesn't do anything anymore ([1]).

[1]: 14b061ba65/mono/metadata/profiler.c (L1098-L1101)
2019-01-28 15:06:40 +01:00
Rolf Bjarne Kvinge 75147cf062
[runtime] Improve rendering/logging of managed exceptions in a few places. (#5293)
* [runtime] Only print the stack trace if we have a stack trace.

* [runtime] Only print 'Unhandled managed exception' when it's actually an unhandled exception.

We render exceptions in several other circumstances, when they're not
unhandled, so this improves the output text in those scenarios a little bit.

* [runtime] Fix typo in logging message.

* [runtime] Improve abort message for managed exception marshalling a bit.
2018-12-20 09:50:08 +01:00
Sebastien Pouliot 7b83195937
Merge pull request #4596 from xamarin/mono-2018-08
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
https://github.com/mono/mono/pull/7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a0 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32af [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: 7d5f4b6136...7bcda192a0

* Revert 4bacab3d5c, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump to mono:2018-08

* Initialize Dependency Injector.

* Fix typo

* Fix llvm build

* Reflect latest X509CertificateImpl changes

* Use same compile flags also for link

Linking can fail if the minimum versions are different

* Bump mono

* Bump mono

* Assembly.LoadFile accepts only absolute path

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [tests] Reference GuiUnit_Net_4_5 using a project reference.

This makes sure GuiUnit is built when the main project is built.

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump mono to pick up hybrid suspend fixes

Pick up the 2018-08 backport (https://github.com/mono/mono/pull/10551)
of https://github.com/mono/mono/pull/10545

This should fix GC hangs when managed code runs on a GCD threadpool worker
thread.

* [builds] Fix target name in llvm36 provisioning

package-llvm-llvm36-32 isn't defined in external/mono/sdks/builds/llvm.mk,
but package-llvm36-llvm32 is.

* Revert "[builds] Fix target name in llvm36 provisioning"

This reverts commit b2338370cb.

* Revert "Fix llvm build"

This reverts commit f668561761.

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump mono

* Bump mono

* Revert "Use same compile flags also for link"

This reverts commit cf205396ff.

* Bump mono to pick up mono/mono@1a309a7b45

* [mmptest] System.Core doesn't depend on Mono.Posix in 2018-08

System.Core doesn't depend on Mono.Posix anymore since it's using the corefx
implementation of pipes now 0f0e31842f

* Bump mono and minimum system mono

* [security]: Make `SecCertificate` work with the latest runtime code.

* Fix the `NATIVE_APPLE_CERTIFICATE` logic; it should only be defined when
  using `XAMARIN_APPLETLS` and not on watch.

* It is no longer allowed to construct `X509Certificate` from a native pointer,
  the `X509Certificate(IntPtr)` and `X509Certificate2(IntPtr)` constructors now
  throw an exception.  Use `X509CertificateImplAppl` directly instead.

* Bump mono

* Bump VSmac min version to 7.7.0.1373

To pick up the fix for https://devdiv.visualstudio.com/DevDiv/_workitems/edit/658916/
Should fix the XM classic build failures

* Revert "Bump VSmac min version to 7.7.0.1373"

This reverts commit b2686bb152.

* Bump to a VSfM version that can build XM Classic projects.

* Bump mono system dependency

* Bump mono

Pick up mono/mono@1644a1a0 - fix for https://github.com/mono/mono/issues/10743

* Bump mono

* Bump mono

* [monotouch-test] Disable X509Certificate(byte[]) tests on watchOS (#4942)

* [monotouch-test] Disable X509Certificate(byte[]) tests on watchOS

* [tests] Add TestRuntime.AssertNotWatchOS()

* fixup WatchOS build

* Bump mono

* Bump mono

* [tests] Disable link-preserve-calendar-1 until we can upgrade it to be a Unified test.

See https://github.com/xamarin/xamarin-macios/pull/4596#issuecomment-428562076
for reference: mono's desktop API changed, the linker behavior the test is
verifying is only expected when using XM's Mobile profile.

* Bump mono

* Revert "[monotouch-test] Disable X509Certificate(byte[]) tests on watchOS (#4942)"

This reverts commit d003a9b918.

* Bump Mono.

* [security]: `NATIVE_APPLE_CERTIFICATE` should now be defined on watchOS as well.

* Mono 2018-08 requires macOS 10.9+, so Xamarin.Mac must as well.

* Bump min mono version for XM system apps.

Using a system mono < 5.18 results in a TypeLoadException:

    Could not resolve type with token 01000032 from typeref (expected class 'Mono.ISystemDependencyProvider' in assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089')

* Bump guiunit to get updated min macOS version.

Commit list for mono/guiunit:

* mono/guiunit@9f67042 Bump min macOS version to 10.9.
* mono/guiunit@0c3159a [Harness] Fix exit code of 0 being reported in case of exceptions in the harness
* mono/guiunit@9b7497c Merge pull request #15 from mono/fix-more-warnings
* mono/guiunit@a264470 Fix more warnings
* mono/guiunit@dd094e7 Merge pull request #14 from mono/fix-warnings
* mono/guiunit@b3afede Fix build warnings

Diff: 1306b0d420...9f67042498

* [tests] More min macOS version setting to 10.9.

* Remove 10.7 & 10.8 availability attributes, since they're redundant now.

* Bump mono

* [2018-08][watchos] Use mono_dangerous_add_raw_internal_call for watchOS icalls (#5030)

* Add optional mono_dangerous_add_raw_internal_call to exports.t4

* Use mono_dangerous_add_raw_internal_call on watchOS for icall registration

Internal calls added with mono_dangerous_add_raw_internal_call run in GC Unsafe
mode under cooperative and hybrid suspend, whereas internal calls added with
mono_add_internal_call run in GC Safe mode since
mono/mono@5756ba4b46 in order for hybrid suspend
to be a transparent replacement for preemptive suspend (the old default).  The
icalls in GC Unsafe mode have a responsibility not to block indefinitely
without manually performing a thread state transition to GC Safe mode, and in
return they avoid a thread state transition when the icall is invoked from a
managed method.

* [mmptest] Less hardcoding.

* Bump minimum mono one that has 'mono_dangerous_add_raw_internal_call'.

* Bump mono

* Bump system mono dependency

* Fixes building mono tests

* [ImageCaptureCore] Remove redundant availability attribute.

* [mtouch] Clear the MONO_THREADS_SUSPEND environment variable before calling the AOT compiler. Works around mono/mono#11765.

Visual Studio for Mac may set MONO_THREADS_SUSPEND, and this ends up confusing
the AOT compiler when compiling for watchOS.

So unset the environment variable before calling the AOT compiler.

Works around https://github.com/mono/mono/issues/11765.
2018-12-06 10:52:19 -05:00
Rolf Bjarne Kvinge 1dee193134
[runtime] Unconditionally write the generated bindings. (#5195)
Otherwise we can run into cases where make things it needs to generate the
bindings, but they're identical to the previous bindings, thus nothing is
written to disk, the filestamp doesn't change, and at the next build make
continues to believe that the bindings have to be regenerated:

    $ make
    GEN      bindings-generated.m
    $ make
    GEN      bindings-generated.m
    [ad infinitum]
2018-11-28 15:01:58 +01:00
Rolf Bjarne Kvinge 34c1d38917 [runtime] Disable debugging by default for watchOS apps on device. (#5184)
The previous default (Wifi) would never work; only Http mode works on watchOS
devices. This means that unless debugging was explicitly disabled (for
instance when running without debugging from the IDE), we'd try to connect in
WiFi mode (and gracefully fail, but showing error messages that are
unnecessary and potentally scary/confusing).
2018-11-27 16:30:32 -05:00
Rolf Bjarne Kvinge 23b7847066 Merge remote-tracking branch 'origin/master' into mono-2018-08 2018-11-26 08:05:36 +01:00
Rolf Bjarne Kvinge 02fe5339a4
[runtime] Clean up public symbols. Fixes #5124. (#5155)
* [runtime] Clean up public symbols. Fixes #5124.

Clean up public symbols, by:

* Symbols that don't need to be public (most of them), can be private.
* Prefix all public symbols with `xamarin_`.
* Add a test to ensure we don't introduce new public symbols.
* Use C symbols instead of mangled C++ symbols, since those are easier to
  handle in the test.

This minimizes the chance of getting into a symbol clash with another native library.

Fixes https://github.com/xamarin/xamarin-macios/issues/5124.

* Some test fixes.
2018-11-21 11:48:15 -05:00
Rolf Bjarne Kvinge f8a254d628 Merge remote-tracking branch 'origin/master' into mono-2018-08 2018-11-16 14:26:50 -05:00
Rolf Bjarne Kvinge 38bae20618
Fix min macOS version confusion. (#5080)
* MIN_OSX_SDK_VERSION: the minimum macOS version we support for running macOS apps.
* MIN_OSX_VERSION_FOR_MAC: the minimum macOS version we support for running XM/XI themselves.

Change our build to make sure the above is respected, and in particular:

* The mac32 and mac64 builds must use MIN_OSX_SDK_VERSION.
* The runtime/ build must use MIN_OSX_SDK_VERSION.
* The tools64 build should use MIN_OSX_VERSION_FOR_MAC.

Also document a bit better the various version variables.
2018-11-05 14:46:41 +01:00
Rolf Bjarne Kvinge 7425218c78 Merge remote-tracking branch 'origin/master' into mono-2018-08 2018-10-30 07:42:02 +01:00
Rolf Bjarne Kvinge c69c74b3d3
Clone files if possible whenever it makes sense. (#5049)
Cloning is faster when supported, and it also saves disk space.
2018-10-29 16:09:30 +01:00
Aleksey Kliger (λgeek) 7449e51bba [2018-08][watchos] Use mono_dangerous_add_raw_internal_call for watchOS icalls (#5030)
* Add optional mono_dangerous_add_raw_internal_call to exports.t4

* Use mono_dangerous_add_raw_internal_call on watchOS for icall registration

Internal calls added with mono_dangerous_add_raw_internal_call run in GC Unsafe
mode under cooperative and hybrid suspend, whereas internal calls added with
mono_add_internal_call run in GC Safe mode since
mono/mono@5756ba4b46 in order for hybrid suspend
to be a transparent replacement for preemptive suspend (the old default).  The
icalls in GC Unsafe mode have a responsibility not to block indefinitely
without manually performing a thread state transition to GC Safe mode, and in
return they avoid a thread state transition when the icall is invoked from a
managed method.
2018-10-26 07:46:28 +02:00
Rolf Bjarne Kvinge ad67a39104
[runtime] Improve diagnostics/behavior in case of failure to contact the IDE when debugging. (#5029)
When debugging watchOS apps on device, we wait forever [1] for a connection to
be established to the IDE (iOS apps wait for only 2 seconds, but that's
because the app will be killed after a while, which we avoid on watchOS by
attaching the native debugger).

Unfortunately our error handling was not quite optimal, which meant that if
the connection to the IDE failed, we'd wait forever instead of launching the
app without attaching the debugger.

So improve this, by printing "Waiting for connection to the IDE..." messages
while trying to connect, and printing detailed log messages if the
connection attempt fails (as well as terminating the wait and launching the
watch app).

[1] In this case forever technically means "1 hour".
2018-10-24 07:52:58 +02:00
Rolf Bjarne Kvinge 74102bce2d Use the zlib-helper.o library built by mono, instead of building our own. (#5021)
This also makes it possible to simplify/remove some of our build logic.
2018-10-22 19:52:45 -04:00
Rolf Bjarne Kvinge c378d6baa5
Add a UserType flag for registered types, and use it to improve the performance for is_user_type. (#5017)
* Refactor type map to have a separate flag field for each type instead of magic location in the array.

Refactor the type map to have a separate flag field for each type instead of a
magic location in the array. This simplifies some code, but also allows us to
introduce more flags in the future (which becomes increasingly complex if the
location in the array is to determine yet another value).

This has neglible performance impacts.

* Add a UserType flag for registered types, and use it to improve the performance for is_user_type.

Reflection in the Objective-C runtime is apparently quite slow, so try to
avoid it by computing the information we need for determining whether a
particular Objective-C type represents a user type or not in the static
registrar.

We store this information in a flag for the type in question in the type map,
and use a binary search to search the type map when needed.

This provides a significant improvement, in particular in the dontlink
scenario (probably because there are many more Objective-C types in the app,
which made Objective-C reflection slow). In fact, it somehow made the dontlink
scenario so fast that it's faster than the linkall scenario (which also
improved, but not nearly as much). While quite inexplicable, it's a consistent
result I've seen over multiple test runs.

Numbers
=======

Test case: 004283d7b6

Fix 1 refers to PR #5009.
Fix 2 refers to PR #5013.
Fix 3 refers to PR #5016.
Fix 4 is this fix.

iPad Air 2
----------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | After fix 4  | Improvement from fix 3 to fix 4 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  | 477 ms |      481 ms |       224 ms |       172 ms |       148 ms |                     24 ms (14%) |           329 ms (69%) |
| Release (dont link) | 738 ms |      656 ms |       377 ms |       201 ms |       146 ms |                     55 ms (27%) |           592 ms (80%) |

iPhone X
--------

| Configuration       | Before | After fix 1 | After fix 2  | After fix 3  | After fix 4  | Improvement from fix 3 to fix 4 | Cumulative improvement |
| ------------------- | ------ | ----------: | -----------: | -----------: | -----------: | ------------------------------: | ---------------------: |
| Release (link all)  |  98 ms |       99 ms |        42 ms |        31 ms |        29 ms |                      2 ms ( 6%) |            69 ms (70%) |
| Release (dont link) | 197 ms |      153 ms |        91 ms |        43 ms |        28 ms |                     15 ms (35%) |           169 ms (86%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 4 (the last) of multiple fixes for #4936.

The total speed-up is 69-86% (3-7x faster).
2018-10-22 07:57:16 +02:00
Rolf Bjarne Kvinge 900356c2e6
[Class] Sort our array of Class -> token references so that we can do binary instead of linear searches in it. (#5009)
Our type map has two sections: first come all the wrapper types, then all the
custom types. This means we need to sort these two sections separately, since
code elsewhere depends on this split in order to determine if a type is a
custom type or not.

We also need a minor modification in the array of skipped types, since it
contained indexes into the type map, which won't be valid after is has been
sorted. Instead store a type reference for the actual type in the array, and
use that to search the type map for the corresponding Class. This is a little
bit slower, but the results are cached in a dictionary, so it'll only happen
once for each type.

The performance is slightly slower when the type map has very few entries, but
that is repaid many times over when the number of entries go up.

Numbers
=======

Test case: 004283d7b6

iPad Air 2
----------

| Configuration       | Before | After  | Improvement   |
| ------------------- | ------ | ------ | ------------: |
| Release (link all)  | 477 ms | 481 ms | -4 ms (-0,8%) |
| Release (dont link) | 738 ms | 656 ms |   82 ms (11%) |

iPhone X
--------

| Configuration       | Before | After  | Improvement |
| ------------------- | ------ | ------ | ----------: |
| Release (link all)  |  98 ms |  99 ms | -1 ms (-1%) |
| Release (dont link) | 197 ms | 153 ms | 44 ms (22%) |

When linking all assemblies, the type map has 24 entries, and when not linking
at all it has 2993 entries.

This is part 1 of multiple fixes for #4936.
2018-10-19 07:33:15 +02:00
Jo Shields 6f2ebedb74 Bump to mono:2018-06 (#4277)
* Bump to mono:2018-06

* Bump mono

* Updates compression to work with the public span

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Fixes pointer check logic in Deflater

* Bump mono

* Bump Mono

* [runtime] always use `mono_jit_set_aot_mode` (#4491)

`mono_jit_set_aot_only` is deprecated and accidentally broke with
https://github.com/mono/mono/pull/7887

This should fix device tests with `mono-2018-06`

* Testing with Zoltan's patch

* Include libmono-system-native on Xamarin.Mac

* Bump Mono

Commit list for mono/mono:

* mono/mono@7bcda192a0 Bump llvm to release_60/fc854b8ec5873d294b80afa3e6cf6a88c5c48886. (#9786). (#9804)
* mono/mono@23e95ec7ad Apply F# portable pdb debug fix for pinvokes & bump (#9797)
* mono/mono@295f6d32af [2018-06] [MacOS] On Mac, use the copyfile API to copy files (#9696)

Diff: 7d5f4b6136...7bcda192a0

* Revert 4bacab3d5c, it doesn't fix the ios aot problems.

* Bump mono

* [tests] Adjust the MT0137 test for mcs change in behavior.

Starting with mono 5.16 mcs will now add assembly references when the assembly
is only used in attributes (this was already the case for csc in both 5.14 and
5.16, so it seems to be a compatibility change).

Adjust the MT0137 test accordingly.

* [msbuild] Fix parsing of json parser errors to handle trailing periods in the error message.

Fixes this test:

    1) Test Failure : Xamarin.iOS.Tasks.Bug60536.TestACToolTaskCatchesJsonException
         ColumnNumber
      Expected: 2
      But was:  0

* Bump mono

* [builds] Install the old llvm binaries into the LLVM36 directory and make the 32 bit builds use that.

* Bump mono

* Bump mono

* [jenkins] Don't give VSTS a fake branch. (#4667)

Something in VSTS changed, and now fake branch names don't work anymore.

So instead use real branch names (and for pull requests I've created a
'pull-request' branch we can use).

* Assembly.LoadFile accepts only absolute path

* [linker] Add new Facade (System.Threading.Tasks.Extensions).

Fixes these MTouch test failures:

    1. Xamarin.Linker.SdkTest.iOS_Unified :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    2. Xamarin.Linker.SdkTest.tvOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

    3. Xamarin.Linker.SdkTest.watchOS :   Facades
      Expected:
      But was:  < "System.Threading.Tasks.Extensions" >

* [mono-sdks] Necessary changes to unify the LLVM provisioning for both iOS and Android. (#4732)

* Bump Mono

* [mtouch] add mixed-mode support (#4751)

* [mtouch] add --interp-mixed option

When enabling this option, mtouch will AOT compile `mscorlib.dll`.  At
runtime that means every method that wasn't AOT'd will be executed by
the runtime interpreter.

* [mtouch] Add support to --interpreter to list the assemblies to (not) interpret.

* [msbuild] Simplify interpreter code to use a single variable.

* Fix whitespace.

* [mtouch] Move mtouch-specific code to mtouch-specific file.

* [msbuild] An empty string is a valid value for 'Interpreter', so make it a non-required property.

* [mtouch] Add sanity check for aot-compiling interpreted assemblies.

* Bump Mono

* [linker] Updates SDKs facades list

* Bump mono

* [msbuild] Adds facades which might override default nuget version to framework list

The collision resolver task reads them from here https://github.com/dotnet/sdk/blob/master/src/Tasks/Common/ConflictResolution/FrameworkListReader.cs

* Bump to a VSfM version that can build XM Classic projects.
2018-10-10 11:02:28 -04:00
Rolf Bjarne Kvinge bbbb5ba8a3
[runtime] Only write to NSLog in chunks of max 4096 characters. Fixes maccore#1014. (#4897)
It seems older iOS versions have a bug where big(ish) chunks of string can
cause it to hang.

Fix this by not writing big strings to NSLog, instead split them up in chunks.

Fixes https://github.com/xamarin/maccore/issues/1014.
2018-10-04 17:18:09 +02:00
Chris Hamons 3119129ab7 Remove references to bugzilla and replace with github (#4920)
https://github.com/xamarin/xamarin-macios/issues/3647
2018-10-04 09:43:55 -04:00
Vincent Dondain 2174ec41a2 Merge branch 'xcode10' 2018-09-18 14:12:39 -04:00
Vincent Dondain 91a52a17f5 Merge branch 'xcode10' into d15-9-merge-xcode10 2018-09-14 12:53:17 -04:00
Rolf Bjarne Kvinge 93c672fbf1 Disable the GC pump by default. Fixes #4772. (#4781)
Fixes https://github.com/xamarin/xamarin-macios/issues/4772
2018-09-10 16:42:42 -04:00
Rolf Bjarne Kvinge 385592b128
[runtime] Throw a managed exception instead of trying to call a null function pointer if the runtime tries to call a function that has been linked away. (#4770)
* [runtime] Throw a managed exception instead of trying to call a null function pointer if the runtime tries to call a function that has been linked away.

* [tests] Add new file for Xamarin.Mac tests.

* Direct people to file issues in github.
2018-09-10 10:56:02 +02:00
Rolf Bjarne Kvinge bd32b74347
Add support for delegates as return values in protocol members. Fixes #4102. (#4758)
* Add support for delegates as return values in protocol members. Fixes #4102.

This required a few changes:

* The generator now emits the DelegateProxy attribute for property getters in
  protocol interfaces.
* The generator now emits the DelegateProxy attribute in ProtocolMember
  attributes (and the ProtocolMember attribute has been extended with
  additional properties for this purpose).
* The generator now emits the BlockProxy attribute for the parameter in
  property setters.
* The generator now emits the BlockProxy attribute in ProtocolMember
  attributes for property setters.
* The static registrar now emits the metadata token for the
  DelegateProxy.DelegateType property into the generated code so that the
  DelegateProxy attribute itself isn't needed at runtime. This is required
  when the dynamic registrar has been optimized away.

Fixes https://github.com/xamarin/xamarin-macios/issues/4102.

* [tests] Update MX4105 test to expect new warnings.
2018-09-06 16:20:23 +02:00
Rolf Bjarne Kvinge 33c1db4b68
Store the minimum mono version for Xamarin.Mac in one place only (Make.config) and bump it to 5.14. Fixes #4120. (#4695)
* Store the minimum mono version for Xamarin.Mac in one place only (Make.config) and bump it to 5.14. Fixes #4120.

I've verified that we fail at launch of running on 5.12, while 5.14 works fine
(to launch at least), so the minimum system mono version is _at least_ 5.14.

Fixes https://github.com/xamarin/xamarin-macios/issues/4120.

* [mmp] Load mono's version file instead of using pkg-config to get mono's version.

pkg-config will only get three parts of the version, while the version file
has all four parts.

This is important, since we're now verifying the four parts of the version
file, and without loading those four from the system, we'll fail builds like
this:

    error MM0001: This version of Xamarin.Mac requires Mono 5.14.0.136 (the current Mono version is 5.14.0).

because the three part version's fourth number is assumed to be 0.

* Only verify mono runtime version when running with system/dynamic mono.

There should be no need to verify the mono runtime version when embedding mono:

* If it's a mono we're shipping, something very bad happened in our
  build/package for it to be an invalid mono.
* If it's a system mono that's being embedded, then we verify in mmp at build
  time.

In the first scenario (a mono we're shipping), the problem is that the mono
we've built does not report back the full version number (with four parts) [1],
which means we'll fail any check whose requirements are identical for the
first three parts, and non-zero for the last.

[1] The fourth part of the version number is created/calculated when packaging
mono, and we're not packaging it.
2018-08-29 14:28:56 +02:00
Manuel de la Pena 91c14f26a7
[Runtime] Small fix for the runtime.h exposed by Emb-4000. Fixes #4442 (#4675)
This fixes issue #4442 by fixing a small struct issues.

https://github.com/xamarin/xamarin-macios/issues/4442
2018-08-22 13:42:01 +02:00
Manuel de la Pena 8012d4cd54
[Runtime] Small fix for the runtime.h exposed by Emb-4000. Fixes #4442 (#4663)
This fixes issue #4442 by fixing a small struct issues.

https://github.com/xamarin/xamarin-macios/issues/4442
2018-08-22 11:16:27 +02:00
Vincent Dondain eec95e881c Merge branch 'd15-8' into xcode10-rebase-15.8 2018-08-13 21:04:56 -04:00
Rolf Bjarne Kvinge e110612118
[registrar] Improve error message when failing to create a managed wrapper for a native handle. (#4360)
* Convert it into a MM8027/MT8027 error (with documentation).
* Add information about the selector and managed method that triggered the error.

Now the problem reported in issue #4254 shows up as:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).
> Additional information:
> 	Selector: popoverController:willRepositionPopoverToRect:inView:
> 	Method: UIKit.UIPopoverController+_UIPopoverControllerDelegate.WillReposition(UIKit.UIPopoverController, CoreGraphics.CGRect ByRef, UIKit.UIView ByRef)

instead of just:

> ObjCRuntime.RuntimeException: Failed to marshal the Objective-C object 0x7f8080412810 (type: UIView). Could not find an existing managed instance for this object, nor was it possible to create a new managed instance (because the type 'UIKit.UIView&' does not have a constructor that takes one IntPtr argument).

which makes it much easier to understand, track down, and fix/work around,
both for customers and ourselves.
2018-06-29 14:38:28 +02:00
Rolf Bjarne Kvinge 0a24bd603d
[runtime] Always release blocks on the main thread. Fixes #4130. (#4312)
Fixes https://github.com/xamarin/xamarin-macios/issues/4130.
2018-06-29 10:42:25 +02:00
Rolf Bjarne Kvinge 41da2d1e28
[runtime] Use public mono API to set the pending exception. Fixes #4271. (#4272)
This makes exception marshaling work with Xamarin.Mac apps that use the system
mono (such as Visual Studio for Mac, and assuming at least a v5.12 system
mono).

https://github.com/xamarin/xamarin-macios/issues/4271
2018-06-15 23:45:02 +02:00
Vincent Dondain 2f1859733d
[arkit] Update to Xcode 10 beta 1 (ARKit 2.0) (#4209)
I obsoleted `GetProjectPoint` in favor of `Project` because of the introduction of `Unproject` (which made me realize the naming was wrong) and based on the API doc https://developer.apple.com/documentation/arkit/arcamera/2923538-projectpoint?language=objc. 

The `CGPoint` returned is the projection of a point. An other naming option would have been `GetProjectedPoint` but I think `Project` is closer to the original and clear enough. You project/unproject something onto something else and you get the projection back.
2018-06-14 13:44:45 -04:00
Sebastien Pouliot 2d6ce7459d
Bump to use Xcode 10 beta 1 (#4179)
* Bump to use Xcode 10 beta 1

* Update Versions.plist

* Add a dependency on Xcode 9.4.

* [msbuild] Fix build with Xcode 10 beta 1. (#4182)

Many years ago (in Xcode 7 according to code comment)
Developer/Platforms/iPhoneOS.platform/Developer/usr disappeared, and we coped
by looking at Developer/usr instead (and also the subsequent code to locate
the bin directory was based on the location of the usr directory).

Developer/Platforms/iPhoneOS.platform/Developer/usr reappeared in Xcode 10
beta 1, but it seems useless (for one it doesn't contain a bin directory), so
in order to try to keep things sane don't look for this directory in Xcode 10
and instead go directly for Developer/usr (which is what we've been using as
the usr directory for years anyway).

Fixes this problem when building apps with Xcode 10 beta 1:

      /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Common.targets(626,3): error : Could not locate SDK bin directory [/Users/rolf/Projects/TestApp/test-app.csproj]

* [runtime] Build 32-bit mac executables using Xcode 9.4.

* [mtouch] Work around broken tvOS headers in Xcode 10 beta 1.

* [mtouch] Work around build problem with Apple's simd headers in Objective-C++ mode.

* Use version-agnostic paths to sdk directories.

* [tests][xtro] Add todo files (from unclassified) and adjust ignore files to avoid errors

* [macos][security] Re-enable SSL[Get|Set]AlpnProtocols. Fixes #4001 (#4022)

* [macos][security] Re-enable SSL[Get}Set]AlpnProtocols. Fixes #4001

This was fixed in macOS 10.13.4

https://github.com/xamarin/xamarin-macios/issues/4001

* [tests][monotouch-tests] Disable a few test cases (one crasher, other failures). Causes to be verified later

* [xharness] Fix permission dialog suppression in Xcode 10.

* [xharness] Ignore 32-bit macOS tests by default.

* [tests] Execute mmp regression tests with Xcode 9.4 since many of them are 32-bit and needs porting to 64-bit.

* [mmptest] Ignore 32-bit XM tests if we don't have a 32-bit-capable Xcode.

* [registrar] Add workaround for broken headers in Xcode 10 beta 1 (radar 40824697).

* [mtouch] Restrict another workaround for an Xcode 10 beta 1 bug to a specific Xcode version to remove it asap.

* [tests] Fix some protocol changes (public or not) find by introspection tests

* [tests][intro] Fix DefaultCtorAllowed failures

* [Intents] Obsolete several Intents classes in watchOS.

Several existing Intents classes have been marked as unavailable in watchOS in
the headers in Xcode 10 beta 1, and corresponding tests are now failing.

So obsolete the managed wrapper types, and fix tests accordingly.

* Fix xtro wrt previous Ietents/intro changes

* [tests] Minor adjustments to mtouch tests to work with Xcode 10.

* [msbuild] Update tests to cope with additional files produced by the Core ML compiler.

* [msbuild] Xcode 10 doesn't support building watchOS 1 apps, so show a clear error message explaining it.

Also update tests accordingly.

* [coreimage] Stub new filters and exclude ?removed? ones from tests

* Update GameplayKit and SpriteKit NSSecureCoding _upgrade_ and fix other non-public cases (in tests)

* [tests] Ignore some GameKit selectors that don't respond anymore (but seems to be available, at least in header files)

* [tests] Fix intro 32bits testing for filters resutls

* [msbuild] Slightly change error message to be better English.
2018-06-08 18:45:24 -07:00
Rolf Bjarne Kvinge 6d04431838
[ObjCRuntime] Improve MarkDirty speed by caching the IsCustomType value in our flags byte. (#4128)
* [ObjCRuntime] Improve MarkDirty speed by caching the IsCustomType value in our flags byte.

This makes calling MarkDirty for custom types ~60x times faster.

Reference: https://xamarinhq.slack.com/archives/C03CCJHCF/p1527194568000197

* We only have one bit left to use for IsCustomType.

* Fix build and make enums between native and managed match.
2018-05-25 05:36:28 -04:00
Rolf Bjarne Kvinge 06834b2a14
[runtime] Avoid using a static library initializer. (#4106)
Avoid using a static library initializer by using a constant recursive mutex
initializer.

Static initializers are bad because there's a significant overhead to executing them.
2018-05-22 08:53:19 -04:00
Bernhard Urban 394117885c
[runtime] add support for mono runtime interpreter (#3058)
* [runtime] build interp-, icalltable- and ilgen libraries so they can be consumed in interpreter configuration

* [mtouch] add --interpreter configuration support

* [xharness] Add support for removing defines from cloned project files.

* [xharness] Run monotouch-test, mscorlib and mini tests with the interpreter too.

They're ignored for now, which means we won't run them on the bots.

* [mtouch] We're using dlsym when using the interpreter.

* [xharness] enable mini regression tests with interpreter on CI
2018-05-04 23:59:31 +02:00
Rolf Bjarne Kvinge 1206b868c2
[runtime] Don't lock while calling selectors that can up calling managed code. Fixes #3943. (#3979)
* [runtime] Don't lock while calling selectors that can up calling managed code. Fixes #3943.

Instead of locking the framework peer lock while we call release on dying
object, we just lock and then immediately unlock again before calling release.

This enforces an execution order that still strong enough to not run into race
conditions, while at the same time not running into deadlocks.

Fixes https://github.com/xamarin/xamarin-macios/issues/3943.
2018-04-27 07:40:03 +02:00
Sebastien Pouliot 5392cb8b9a Remove more usage of mcs across the build and tests (#3815)
* Remove more usage of mcs across the build and tests

* Fix -o[ut] mcs/csc argument difference

* Fix OpenTK.[dll.mdb|pdb]

* Complete some MCS|CSC renames

* Fix SYSTEM_CSC not to have a default option since it's not usable that way in every case (and most of them already deal with that option)

* Do not rename a variable used by mono itself

* Un-renamed two other variables

* Fix copying pdb

* Generate debug symbols for *.BindingAttributes.dll and copy .mdb for the old XamMac binary version

* Newer csc-compiled XamMac.BindingAttributes.dll have .pdb while the old, mcs-compiled binary cached, version has a .mdb

* Fix msc -> mcs typo.
2018-04-18 11:17:00 +02:00
Eberhard Beilharz 78583313eb Fix download path for mono (#3681) 2018-03-07 14:46:59 +01:00
Rolf Bjarne Kvinge e45a218f6d
[runtime] Enable signal chaining for Xamarin.Mac apps. (#3631) (#3642)
Reported in the forums: https://forums.xamarin.com/discussion/122594/xamarin-mac-signal-handling
2018-03-05 14:54:01 +01:00
Rolf Bjarne Kvinge 835f65897f
[static registrar] Optimize creation of delegates for blocks. (#3623) (#3644)
* [static registrar] Optimize creation of delegates for blocks.

Optimize creation of delegates for blocks so that it doesn't require the
dynamic registrar.

This is done by getting the metadata token for the Create method that creates
the delegate, and embed that metadata token in the generated code from the
static registrar.

Also add tests, since this scenario was not covered by tests already.

* [mmptest] Fix test after recent changes.

* [test-libraries] Avoid duplicate symbols.

* [tests] Update according to changes.
2018-03-05 07:41:28 +01:00
Rolf Bjarne Kvinge b131a54be5
[static registrar] Optimize creation of delegates for blocks. (#3623)
* [static registrar] Optimize creation of delegates for blocks.

Optimize creation of delegates for blocks so that it doesn't require the
dynamic registrar.

This is done by getting the metadata token for the Create method that creates
the delegate, and embed that metadata token in the generated code from the
static registrar.

Also add tests, since this scenario was not covered by tests already.

* [mmptest] Fix test after recent changes.

* [test-libraries] Avoid duplicate symbols.

* [tests] Update according to changes.
2018-03-02 14:30:18 +01:00
Rolf Bjarne Kvinge 4be1cd723b
[runtime] Enable signal chaining for Xamarin.Mac apps. (#3631)
Reported in the forums: https://forums.xamarin.com/discussion/122594/xamarin-mac-signal-handling
2018-03-02 09:42:16 +01:00
Chris Hamons c9fac28a8f
Fixes for Embeddinator after header changes (#3607)
- Two locations in our runtime headers were unable to be compiled outside of ObjC++ (Embeddinator)
2018-03-01 11:04:01 -06:00
Rolf Bjarne Kvinge 16d219639d
[runtime] Fix exception marshalling when the dynamic registrar is removed. (#3616) (#3619)
This can be reproduced by running monotouch-test with all optimizations in
Debug mode (because some of the exception marshalling tests are only enabled
in debug mode), so add such a configuration to xharness. To avoid bloating PR
builds, this configuration is only enabled when running all tests (either
manually selecting all tests for a PR, or on Wrench, where everything is
always tested).
2018-03-01 14:56:29 +01:00
Rolf Bjarne Kvinge 514a3de817
[runtime] Fix exception marshalling when the dynamic registrar is removed. (#3616)
This can be reproduced by running monotouch-test with all optimizations in
Debug mode (because some of the exception marshalling tests are only enabled
in debug mode), so add such a configuration to xharness. To avoid bloating PR
builds, this configuration is only enabled when running all tests (either
manually selecting all tests for a PR, or on Wrench, where everything is
always tested).
2018-02-28 22:28:06 +01:00
Rolf Bjarne Kvinge 44b677599d [runtime] Mark managed callback functions if they're only used in the dynamic registrar.
Mark managed callback functions if they're only used in the dynamic registrar,
and only initialize the corresponding delegate if the dynamic registrar is
available.

This will make it possible for the linker to remove those managed functions if
the dynamic registrar is being removed.
2018-02-15 10:18:32 +01:00
Rolf Bjarne Kvinge 92f8fab14b [mtouch/mmp] Add support for inlining calls to Runtime.DynamicRegistrarSupported and removal of the dynamic registrar. 2018-02-15 10:18:27 +01:00
Rolf Bjarne Kvinge 1de94d444b [static registrar] Create a table of interface -> protocol in the static registrar.
Create a table of interface -> protocol in the static registrar, since we need
to be able to look up a protocol given a managed type without looking at the
(possibly linked away) [Protocol] attribute.
2018-02-13 19:38:35 +01:00
Rolf Bjarne Kvinge 2b76428a16 [mtouch/mmp] Generate table of protocols and their corresponding wrapper type in the static registrar.
Generate table of protocols and their corresponding wrapper type in the static
registrar, so that we don't have to look for this information using the
dynamic registrar at runtime.
2018-02-12 14:46:00 +01:00
Rolf Bjarne Kvinge bf8787c748
[ObjCRuntime] Add support for getting the native ObjC class for a given System.Type without using the dynamic registrar. (#3424)
* [ObjCRuntime] Add support for getting the native ObjC class for a given System.Type without using the dynamic registrar.

* The static registrar now generates a table of any types that skipped
  registration (which is currently used for generic types, such as
  `NSArray<T>`), that allows us to look up the corresponding native type.

* In Runtime.Class now look in the tables generated by the static registrar to
  find the native ObjC class for any given System.Type.

* Store the results in a dictionary so that the lookup isn't slower than
  before (in fact it's ~4x faster now).

* [registrar] Elevate debug spew into a proper error.

* [registrar] Don't process 64bit-only skipped types on 32-bits.

This also requires fixing the registrar's parsing of the new [iOS] and [Mac]
availability attributes
2018-02-08 15:28:01 +01:00
Rolf Bjarne Kvinge 309b8d08b6
[runtime] Make const what can const be. (#3412)
This might make the compiler able to put the data in read-only memory.
2018-02-07 19:28:59 +01:00
Rolf Bjarne Kvinge 97230c28e1
Optimize calls to BlockLiteral.SetupBlock to inject the block signature. (#3391)
* [linker] Optimize calls to BlockLiteral.SetupBlock to inject the block signature.

Optimize calls to BlockLiteral.SetupBlock[Unsafe] to calculate the block
signature at build time, and inject it into the call site.

This makes block invocations 10-15x faster (I've added tests that asserts at
least an 8x increase).

It's also required in order to be able to remove the dynamic registrar code in
the future (since calculating the block signature at runtime requires the
dynamic registrar).

* [mtouch/mmp] Add support for reporting errors/warnings that point to the code line causing the error/warning.

Add support for reporting errors/warnings that point to the code line causing
the error/warning by adding ErrorHelper overloads that take the exact
instruction to report (previously we defaulted to the first line/instruction
in a method).

* [tests] Add support for asserting filename/linenumber in warning messages.

* Make all methods that manually create BlockLiterals optimizable.

* [tests] Create a BaseOptimizeGeneratedCodeTest test that's included in both XI's and XM's link all test.

* [tests] Add link all test (for both XI and XM) to test the BlockLiteral.SetupBlock optimization.

* [tests] Add mtouch/mmp tests for the BlockLiteral.SetupBlock optimization.

* [tests][linker] Make the base test class abstract, so tests in the base class aren't executed twice.

* [tests][linker] Don't execute linkall-only tests in linksdk.

The optimization tests only apply when the test assembly is linked, and that
only happens in linkall, so exclude those tests in linksdk.

* [tests][mmptest] Update test according to mmp changes.

Fixes these test failures:

    1) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("inline-runtime-arch")
    The warning 'MM0132: Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'inline-runtime-arch'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

    2) Failed : Xamarin.MMP.Tests.MMPTests.MM0132("foo")
    The warning 'MM0132: Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.' was not found in the output:
    	Message #1 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'
    	Message #2 did not match:
    		actual:   'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size, blockliteral-setupblock.'
    		expected: 'Unknown optimization: 'foo'. Valid optimizations are: remove-uithread-checks, dead-code-elimination, inline-isdirectbinding, inline-intptr-size.'

* [tests][linker] Fix typo.

Fixes this test failure:

    1) SetupBlock_CustomDelegate (Linker.Shared.BaseOptimizeGeneratedCodeTest.SetupBlock_CustomDelegate)
         Counter
      Expected: 1
      But was:  2

* [registrar] Minor adjustment to error message to match previous (and better) behavior.

Fixes this test failure:

    1) Failed : Xamarin.Registrar.GenericType_WithInvalidParameterTypes
    The error 'MT4136: The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)'' was not found in the output:
    	Message #1 did not match:
    		actual:   'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<Foundation.NSObject>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''
    		expected: 'The registrar cannot marshal the parameter type 'System.Collections.Generic.List`1<U>' of the parameter 'arg' in the method 'Open`1.Bar(System.Collections.Generic.List`1<U>)''

* [docs] mmp shows MM errors/warnings.

* [docs] Improve according to reviews.

* [tests] Fix merge failure causing test duplication.
2018-02-06 07:08:15 +01:00
Chris Hamons c0202e0e2b
PMCS Removal (#3197)
You were the preprocessor we wished C# had natively

Removing PMCS requires these changes:
* Remove XamCore from src/
* Remove XamCore from tools/
* Remove XamCore from runtime/
* nint/nuint enum conversion
* _compat_ enum conversion
* NSAction conversion
* Hand fix single API incorrectly converted by PMCS to unbreak compatibility
   - Due to a bug in PMCS, the nuint was incorrectly converted in this API.
   - However, as that ship as sailed, we must "fix" it until XAMCORE_4_0
* Update readme
* Bump macios-binaries
2018-02-05 10:26:29 -05:00
Rolf Bjarne Kvinge 5319266503
[static registrar] Compute the conversion methods for smart enums and embed those as token references in the generated code. (#3385)
Converting to and from smart enums and their corresponding native value
requires knowing the conversion function, since each smart enum has its own
conversion function.

The dynamic registrar can do this at runtime, but it's something that can be
computed in the static registrar at build time, so do that. The static
registrar will now embed the metadata token (as a token reference) in the
generated code, which can be used at runtime to find the conversion method,
without requiring anything from dynamic registrar.

This requires some refactoring in the conversion methods to allow passing more
information around (the `context` parameter in the conversion functions, which
the smart enum conversion methods now use for the token reference).

It turns out this is a massive improvement (although the scenarios where this
is relevant are rare): a simple test case [1] is 300x faster (from ~30s to
0.1s).

[1]: https://gist.github.com/rolfbjarne/961af28d1c2727b256fbcdfd6aa65e98
2018-02-05 07:54:13 +01:00
Marius Ungureanu 5d50f81cb8 [runtime] Use mono's runtime default to load config files when it's not embedded (#3290)
* [Launcher] Don't set the configuration dir to the bundle

When using system-mono launcher, do not make mono probe for
configuration files in the bundle, but rather rely on the
default behaviour of system mono resolving it to /etc/mono

* Update comments
2018-01-29 16:58:33 +01:00
Rolf Bjarne Kvinge 369271d7b8
[runtime] Remove specialized function for getting the Selector/Class handle of a managed Selector/Class instance. (#3227)
* [runtime] Remove specialized function for getting the Selector/Class handle of a managed Selector/Class instance.

The existing function to get the handle of an INativeObject works just as fine.

* [runtime] Store and use a prebuilt XamMacLauncher.

Some changes in the runtime needs corresponding changes in XamMac.dll, but
since we're not changing XamMac.dll anymore, we can't change the runtime
either.

This means that we must add XamMacLauncher to the list of binaries we copy.

* [runtime] Store and use a prebuilt libxammac*.a as well.
2018-01-22 21:16:41 +01:00
Rolf Bjarne Kvinge b4195aba9c
[runtime] Generate a header with the function declarations to call into managed code. (#3224)
We already have the information we need to generate these function
declaration, so this prevents the need for keeping information in two
different places up-to-date.
2018-01-15 15:08:59 +01:00
Rolf Bjarne Kvinge 5ca0b58e04
[runtime] Add a few asserts to avoid reading memory. (#3202)
[runtime] Add a few asserts to avoid reading invalid memory.
2018-01-12 17:05:20 +01:00
Rolf Bjarne Kvinge 0f67cd4893
[runtime] Remove dead code. (#2965) 2017-11-07 16:11:46 +01:00
Sebastien Pouliot 395feca0d9 Merge branch 'xcode9.1' into master-merge-xcode91-take2 2017-11-03 10:30:07 -04:00
Rolf Bjarne Kvinge 610dcc8a03 [runtime] Don't hold the framework lock when running managed code. Fixes #59994. (#2848)
There is a deadlock between the framework lock and the GC lock; resolve this
by making sure we don't execute managed code while holding the framework lock.

The framework lock was introduced in
xamarin/maccore@4a0748b1d8, and from analyzing
that commit message, it seems we're safe as long as nobody retains/releases
NSObjects (in way that makes the retainCount jump to or from 1) while the GC
runs.

Calling `xamarin_unregister_nsobject` does not affect the retain count of the
object; thus it's not necessary to keep the lock during the call to
`xamarin_unregister_nsobject`.

https://bugzilla.xamarin.com/show_bug.cgi?id=59994
4a0748b1d8
2017-10-09 10:59:25 +02:00
Alex Soto aa2c533501 [ModelIO] Adds Xcode 9 Beta 1 to Stable API bindings (#2832)
* [ModelIO] Adds Xcode 9 Beta 1 to Stable API bindings

* implement feedback

* implement Tim's feedback
2017-10-05 20:32:25 +02:00
Rolf Bjarne Kvinge ac45813621 [runtime] Call mono_raise_exception if mono_set_pending_exception isn't available. Works around bug #59979 (#2845)
mono_set_pending_exception is a private mono symbol, which means we won't find
it when using the system mono (as a dynamic library). In that case, we'd
abort.

Instead try to call mono_raise_exception, and hope for the best. It will leak
somewhat, but that's still better than asserting.

This changes the generated wrapper function from:

```c
MONO_API void
mono_set_pending_exception (MonoException * exc)
{
	if (mono_set_pending_exception_func == NULL)
		xamarin_assertion_message ("Could not load mono_set_pending_exception\n");

	return mono_set_pending_exception_func (exc);
}
```

to

```c
MONO_API void
mono_set_pending_exception (MonoException * exc)
{
	if (mono_set_pending_exception_func == NULL)
		return mono_raise_exception (exc);

	return mono_set_pending_exception_func (exc);
}
```

Also this only applies to Xamarin.Mac apps that use the system mono (such as VSfM).

https://bugzilla.xamarin.com/show_bug.cgi?id=59979
2017-10-05 18:13:44 +02:00