Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix instance size emission in ILCompiler to handle indeterminate sizes #115293

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

Merged
merged 2 commits into from
May 6, 2025

Conversation

dadavadd
Copy link
Contributor

@dadavadd dadavadd commented May 5, 2025

This PR fixes incorrect class size emission for reference types in NativeAOT PDBs, which caused IDA and other debuggers to ignore most fields.

See discussion and issue here:
#115283 (comment)

Before this fix, the emitted size would always be the pointer size (e.g., 8), even if the actual instance size was known and available. This caused debuggers to parse only the base class portion of the type.

After this fix, we use defType.InstanceByteCount instead of GetElementSize() for class types when the size is determinate.

@dadavadd dadavadd requested a review from MichalStrehovsky as a code owner May 5, 2025 01:31
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label May 5, 2025
Copy link
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@MichalStrehovsky MichalStrehovsky left a comment

Choose a reason for hiding this comment

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

Thanks!

@MichalStrehovsky MichalStrehovsky merged commit acb453d into dotnet:main May 6, 2025
91 of 93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-NativeAOT-coreclr community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants