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

[cdac] Begin adding MethodDesc APIs to the RuntimeTypeSystem contract #104811

Merged
merged 25 commits into from
Jul 20, 2024

Conversation

lambdageek
Copy link
Member

@lambdageek lambdageek commented Jul 12, 2024

Contributes to #99302

This is largely a placeholder just to get the MethodDesc/MethodDescChunk infrastructure in place. To further fill out ValidateMethodDesc and to implement the GetMethodDescData DAC API, I also need to add an executable code manager contract for mapping between native code pointer values and methods. I'd like to do that as a separate PR.

Debugged WinDbg enough to verify that GetMethodDescData is implemented enough to extract the correct MethodTable pointer value from a MethodDesc.

Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

docs/design/datacontracts/RuntimeTypeSystem.md Outdated Show resolved Hide resolved
src/coreclr/debug/runtimeinfo/datadescriptor.h Outdated Show resolved Hide resolved
{
// may throw if the method desc at methodDescPointer is corrupted
// we bypass the target data cache here because we don't want to cache non-validated data
Data.MethodDesc desc = new Data.MethodDesc(_target, methodDescPointer);
Copy link
Member

Choose a reason for hiding this comment

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

For the existing non-validated types, we only read the parts that are needed to do the validation. For this, we're always going to read everything on MethodDesc/MethodDescChunk - are we expecting to need most of it / do we care about trying to read only what is needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we're going to need to access most of the fields of the MethodDesc base class for validation: you have to compute the MethodDescChunk address right away, and after that the first check is looking at the flags and the slot.

docs/design/datacontracts/RuntimeTypeSystem.md Outdated Show resolved Hide resolved
src/coreclr/debug/daccess/request.cpp Show resolved Hide resolved
src/native/managed/cdacreader/src/Data/MethodDesc.cs Outdated Show resolved Hide resolved
src/coreclr/vm/method.hpp Outdated Show resolved Hide resolved
lambdageek and others added 2 commits July 20, 2024 09:36
Co-authored-by: Elinor Fung <elfung@microsoft.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants