From cf03276a344f72f6a55243e3181534a7bc815256 Mon Sep 17 00:00:00 2001 From: Max Charlamb <44248479+max-charlamb@users.noreply.github.com> Date: Wed, 11 Dec 2024 04:30:49 -0800 Subject: [PATCH] [cDAC] SOSDacImpl::GetMethodDescData DynamicMethodObject (#110545) * 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 --- .../managed/cdacreader/src/Legacy/SOSDacImpl.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs b/src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs index e9c9644121eb1..fbd747b3df172 100644 --- a/src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs +++ b/src/native/managed/cdacreader/src/Legacy/SOSDacImpl.cs @@ -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; } @@ -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);