Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<!-- Workaround for https://github.com/xamarin/xamarin-android/issues/6626, remove once https://github.com/dotnet/runtime/pull/68265 lands -->
<assembly fullname="System.Private.CoreLib">
<type fullname="System.Runtime.ExceptionServices.FirstChanceExceptionEventArgs">
<method signature="System.Void .ctor(System.Exception)" />
Comment on lines +4 to +6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@akoeplinger: why doesn't the linker already preserve this method?

At a glance, it's because the only managed code that creates an instance of FirstChanceExceptionEventArgs is in NativeAOT: https://github.com/dotnet/runtime/blob/2389815a1bc810b5b3c39586b570cbaae2f0f3a5/src/coreclr/nativeaot/System.Private.CoreLib/src/System/AppContext.CoreRT.cs#L14

Oddly, the only native code I see which uses FirstChanceExceptionEventArgs is CoreCLR, e.g.

I can't easily find any Mono dotnet/runtime code which mentions FirstChanceExceptionEventArgs.

Thus it looks like we need the PreserveList because it's native code which is creating an instance of the type, but it would be nice to know which mono code is creating this instance. Or does Mono also use excep.cpp?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it's that object.c code from mono, nothing in the BCL references the ctor.

</type>
</assembly>
</linker>