[Mono.Android] Print type & member remapping info (#7844) #7847
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.
Context: f6f11a5
Context: f99fc81
How do we diagnose type & member remapping issues? If (when) things don't work as anticipated, what do we do?
If a method is remapped and the remapped-to method cannot be found, then Java.Interop will write a message to stderr:
which is a scenario we think/assume Shouldn't Happen™. If it does happen, we believe that the above message will be sufficient to fix the problem.
However, in the "happy" path in which the replacement method is found or the "less-happy" path in which nothing happens, how do we get insight to check or verify what's going on?
Update
AndroidTypeManager.GetStaticMethodFallbackTypesCore()
andAndroidTypeManager.GetReplacementMethodInfoCore()
so that they print out successful type & member remapping when the "assembly" log category is enabled:When the assembly log category is enabled, invocations of
AndroidTypeManager.GetStaticMethodFallbackTypesCore()
will print messages such as the following toadb logcat
:When the assembly log category is enabled, invocations of
AndroidTypeManager.GetReplacementMethodInfoCore()
will print messages such as the following toadb logcat
when a replacement method will be attempted:
This will hopefully provide enough information to reason through type and member remapping behavior.
Additionally, as this is a cherry-pick of a983fbb to the release/7.0.2xx branch, apply a small subset of 77678eb: