Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

R2RDump improvements #46833

Merged
merged 2 commits into from
Jan 12, 2021
Merged

R2RDump improvements #46833

merged 2 commits into from
Jan 12, 2021

Conversation

nattress
Copy link
Contributor

  • Fix handling of module override token in signature parser. When the override is present, a new SignatureDecoder is created and used as the decoder for the final signature with the fixup kind (and module override flag which is stored in the upper bit of the fixup kind byte) already parsed. This causes the remainder of the signature to be parsed as a full R2R signature which is now missing the fixup type. This fixes R2RDump fails for System.IO.FileSystem #46210.
  • Instead of creating a new decoder when a module override is present, set up the initial decoder's metadata reader in the constructor by detecting the module override up front.
  • Fix TryLocateNativeReadyToRunHeader to swallow BadImageFormatException and return true / false whether the image has a native R2R header (for composite images).
  • Running R2RDump on IL assemblies with no R2R now emits an error message that the assembly is not R2R instead of an unhelpful error about some RVA offset conversion failing.

* Fix `TryLocateNativeReadyToRunHeader` to swallow `BadImageFormatException` and return true / false whether the image has a native R2R header (for composite images).
* Running R2RDump on IL assemblies with no R2R now emits an error message that the assembly is not R2R instead of an unhelpful error about some RVA offset conversion failing.
* Fix handling of module override token in signature parser. When the override is present, a new SignatureDecoder is created and used as the decoder for the final signature with the fixup kind (and module override flag which is stored in the upper bit of the fixup kind byte) already parsed. This causes the remainder of the signature to be parsed as a full R2R signature which is now missing the fixup type.
* Instead of creating a new decoder when a module override is present, set up the initial decoder's metadata reader in the constructor by detecting the module override up front.
@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the area-R2RDump-coreclr Ready-to-run image dump tool label Jan 11, 2021
@nattress nattress requested a review from trylek January 11, 2021 22:45
Copy link
Member

@trylek trylek left a comment

Choose a reason for hiding this comment

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

Looks awesome, thanks for fixing these!

@nattress nattress merged commit 0fd7a3f into dotnet:master Jan 12, 2021
@nattress nattress deleted the R2RDump_fixes branch January 12, 2021 02:20
@ghost ghost locked as resolved and limited conversation to collaborators Feb 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-R2RDump-coreclr Ready-to-run image dump tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

R2RDump fails for System.IO.FileSystem
3 participants