Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the right names: https://source.dot.net/#System.Private.CoreLib/FirstChanceExceptionEventArgs.cs,9
There was a problem hiding this comment.
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
FirstChanceExceptionEventArgsis in NativeAOT: https://github.com/dotnet/runtime/blob/2389815a1bc810b5b3c39586b570cbaae2f0f3a5/src/coreclr/nativeaot/System.Private.CoreLib/src/System/AppContext.CoreRT.cs#L14Oddly, the only native code I see which uses
FirstChanceExceptionEventArgsis 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?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's:
https://github.com/dotnet/runtime/blob/6c7ce85e149eaaf4cc452a7008754d5c799db938/src/mono/mono/metadata/object.c#L94
There was a problem hiding this comment.
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.