-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Adding GetILForModule cDAC API #118546
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
Adding GetILForModule cDAC API #118546
Conversation
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.
Pull Request Overview
This PR implements the GetILForModule
cDAC API, which retrieves the address of IL (Intermediate Language) code for a given module and relative virtual address (RVA). The implementation replaces a placeholder that delegated to legacy code with a full cDAC-based solution.
Key changes:
- Adds complete implementation of
GetILForModule
in SOSDacImpl with proper parameter validation and error handling - Introduces new
GetILAddr
method in the ILoader contract to calculate IL addresses from PE assembly data - Includes DEBUG-only verification against legacy implementation to ensure compatibility
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
SOSDacImpl.cs | Replaces placeholder with full GetILForModule implementation including validation, error handling, and debug verification |
Loader_1.cs | Implements GetILAddr method to calculate IL addresses by traversing PE assembly, image, and layout structures |
ILoader.cs | Adds GetILAddr method signature to the ILoader contract interface |
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
That's only true on Windows for files loaded from disk. IsMapped is typically false on non-Windows for non-R2R binaries. Also, it is likely false for binaries loaded from memory (e.g. using |
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs
Outdated
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs
Outdated
Show resolved
Hide resolved
...native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Contracts/Contracts/Loader_1.cs
Outdated
Show resolved
Hide resolved
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader.Abstractions/Target.cs
Outdated
Show resolved
Hide resolved
Test build break, LGTM otherwise |
src/native/managed/cdac/Microsoft.Diagnostics.DataContractReader/ContractDescriptorTarget.cs
Outdated
Show resolved
Hide resolved
…er/ContractDescriptorTarget.cs Co-authored-by: Max Charlamb <[email protected]>
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.
lgtm except for a couple of small comments
A couple comments on this one: