Skip to content
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,38 @@ int IXCLRDataModule.EndEnumMethodInstancesByName(ulong handle)
=> LegacyFallbackHelper.CanFallback() && _legacyModule is not null ? _legacyModule.EndEnumMethodInstancesByName(handle) : HResults.E_NOTIMPL;

int IXCLRDataModule.GetMethodDefinitionByToken(/*mdMethodDef*/ uint token, DacComNullableByRef<IXCLRDataMethodDefinition> methodDefinition)
=> LegacyFallbackHelper.CanFallback() && _legacyModule is not null ? _legacyModule.GetMethodDefinitionByToken(token, methodDefinition) : HResults.E_NOTIMPL;
{
int hr = HResults.S_OK;
int hrLocal = HResults.S_OK;
IXCLRDataMethodDefinition? legacyMethod = null;
try
{
if (_legacyModule is not null)
{
DacComNullableByRef<IXCLRDataMethodDefinition> legacyMethodOut = new(isNullRef: false);
hrLocal = _legacyModule.GetMethodDefinitionByToken(token, legacyMethodOut);
legacyMethod = legacyMethodOut.Interface;
}

if ((EcmaMetadataUtils.TokenType)(token & EcmaMetadataUtils.TokenTypeMask) != EcmaMetadataUtils.TokenType.mdtMethodDef)
throw new ArgumentException();

methodDefinition.Interface = new ClrDataMethodDefinition(_target, _address, token, legacyMethod);
}
Comment thread
max-charlamb marked this conversation as resolved.
catch (System.Exception ex)
{
hr = ex.HResult;
}

#if DEBUG
if (_legacyModule is not null)
{
Debug.ValidateHResult(hr, hrLocal);
}
#endif

return hr;
}
Comment thread
max-charlamb marked this conversation as resolved.

int IXCLRDataModule.StartEnumDataByName(char* name, uint flags, IXCLRDataAppDomain? appDomain, IXCLRDataTask? tlsTask, ulong* handle)
=> LegacyFallbackHelper.CanFallback() && _legacyModule is not null ? _legacyModule.StartEnumDataByName(name, flags, appDomain, tlsTask, handle) : HResults.E_NOTIMPL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,17 @@ internal static class LegacyFallbackHelper
// IMetaDataImport QI — needed until managed MetadataReader wrapper lands (PR #127028).
nameof(ICustomQueryInterface.GetInterface),

// IXCLRDataModule — not yet implemented in the cDAC.
nameof(IXCLRDataModule.GetMethodDefinitionByToken),

// GC heap analysis — not yet implemented in the cDAC (PR #125895).
nameof(ISOSDacInterface11.IsTrackedType),

// Loader heap traversal — not yet implemented in the cDAC (PR #125129).
nameof(ISOSDacInterface.TraverseLoaderHeap),

// IXCLRDataMethodDefinition — not yet implemented in the cDAC.
nameof(IXCLRDataMethodDefinition.StartEnumInstances),
nameof(IXCLRDataMethodDefinition.GetName),
nameof(IXCLRDataMethodDefinition.SetCodeNotification),
nameof(IXCLRDataMethodDefinition.HasClassOrMethodInstantiation),
Comment thread
max-charlamb marked this conversation as resolved.
};

// Files whose methods are all allowed to fall back.
Expand Down