Skip to content

Commit

Permalink
[cDAC] SOSDacImpl::GetMethodDescData DynamicMethodObject (dotnet#110545)
Browse files Browse the repository at this point in the history
* allow SOSDacImpl::GetMethodDescData to handle dynamic functions
* zero-out managedDynamicMethodObject as it is not being used and cDAC does not yet support fetching managed fields
  • Loading branch information
max-charlamb authored and hez2010 committed Dec 14, 2024
1 parent d564cb3 commit 22001f7
Showing 1 changed file with 7 additions and 5 deletions.
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.
Debug.Assert(data->managedDynamicMethodObject == 0);
Debug.Assert(data->requestedIP == dataLocal.requestedIP);
Debug.Assert(data->cJittedRejitVersions == dataLocal.cJittedRejitVersions);

Expand Down

0 comments on commit 22001f7

Please sign in to comment.