Skip to content

Conversation

@larkliy
Copy link
Contributor

@larkliy larkliy 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.

@larkliy larkliy 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
@dotnet-policy-service
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
@larkliy larkliy deleted the fix-ilc-instance-size branch May 7, 2025 11:07
@github-actions github-actions bot locked and limited conversation to collaborators Jun 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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