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] SOSDacImpl::GetMethodDescData DynamicMethodObject #110545

Merged
merged 6 commits into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,11 @@ int ISOSDacInterface.GetMethodDescData(ulong methodDesc, ulong ip, DacpMethodDes
}
#endif

if (data->bIsDynamic != 0)
{
throw new NotImplementedException(); // TODO[cdac]: get the dynamic method managed object
}
// Unlike the legacy implementation, the cDAC does not currently populate
// data->managedDynamicMethodObject. This field is unused in both SOS and CLRMD
// and would require accessing CorLib bound managed fields which the cDAC does not
// currently support. However, it must remain in the return type for compatibility.
data->managedDynamicMethodObject = 0;

hr = HResults.S_OK;
}
Expand Down Expand Up @@ -405,7 +406,8 @@ int ISOSDacInterface.GetMethodDescData(ulong methodDesc, ulong ip, DacpMethodDes
Debug.Assert(data->MDToken == dataLocal.MDToken);
Debug.Assert(data->GCInfo == dataLocal.GCInfo);
Debug.Assert(data->GCStressCodeCopy == dataLocal.GCStressCodeCopy);
Debug.Assert(data->managedDynamicMethodObject == dataLocal.managedDynamicMethodObject);
// managedDynamicMethodObject is not currently populated by the cDAC API and may differ from legacyImpl.
Copy link
Member

Choose a reason for hiding this comment

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

Where is the managedDynamicMethodObject field actually zero'ed? I don't see it anywhere. I'm not sure if you should rely on the client to zero it (like in dacprivate.h). It may not be enough i.e. CLRMD doesn't use that include file.

Copy link
Contributor Author

@max-charlamb max-charlamb Dec 9, 2024

Choose a reason for hiding this comment

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

I see. I wasn't sure if the return memory region would be zero'd to begin with, but that makes sense. I'll zero out the field to make sure it is always returned with 0.

Debug.Assert(data->managedDynamicMethodObject == 0);
Debug.Assert(data->requestedIP == dataLocal.requestedIP);
Debug.Assert(data->cJittedRejitVersions == dataLocal.cJittedRejitVersions);

Expand Down
Loading