diff --git a/eng/pipelines/diagnostics/runtime-diag-job.yml b/eng/pipelines/diagnostics/runtime-diag-job.yml index 0c8009aaf8a8e2..7103c4285e6ea6 100644 --- a/eng/pipelines/diagnostics/runtime-diag-job.yml +++ b/eng/pipelines/diagnostics/runtime-diag-job.yml @@ -41,7 +41,7 @@ parameters: jobs: - template: /eng/common/${{ parameters.templatePath }}/job/job.yml parameters: - name: ${{ coalesce(parameters.name, parameters.osGroup) }}_${{ parameters.archType }}_${{ parameters.buildConfig }} + name: ${{ parameters.name }}_${{ parameters.osGroup }}_${{ parameters.archType }}_${{ parameters.buildConfig }} pool: ${{ parameters.pool }} container: ${{ parameters.container }} condition: and(succeeded(), ${{ parameters.condition }}) @@ -80,7 +80,7 @@ jobs: - ${{ if eq(variables['System.TeamProject'], 'internal') }}: - group: DotNet-HelixApi-Access - group: AzureDevOps-Artifact-Feeds-Pats - + - _PhaseName: ${{ coalesce(parameters.name, parameters.osGroup) }}_${{ parameters.archType }}_${{ parameters.buildConfig }} - _Pipeline_StreamDumpDir: $(Build.SourcesDirectory)/artifacts/tmp/${{ parameters.buildConfig }}/streams diff --git a/eng/pipelines/runtime-diagnostics.yml b/eng/pipelines/runtime-diagnostics.yml index 8bb7f16178f13b..4417a146702eff 100644 --- a/eng/pipelines/runtime-diagnostics.yml +++ b/eng/pipelines/runtime-diagnostics.yml @@ -66,7 +66,7 @@ extends: platforms: - windows_x64 jobParameters: - name: Windows + name: cdac_with_fallback isOfficialBuild: ${{ variables.isOfficialBuild }} liveRuntimeDir: $(Build.SourcesDirectory)/artifacts/runtime timeoutInMinutes: 360 @@ -92,3 +92,38 @@ extends: buildConfiguration: $(_BuildConfig) continueOnError: true condition: always() + - template: /eng/pipelines/common/platform-matrix.yml + parameters: + jobTemplate: /eng/pipelines/diagnostics/runtime-diag-job.yml + buildConfig: release + platforms: + - windows_x64 + jobParameters: + name: cdac_no_fallback + isOfficialBuild: ${{ variables.isOfficialBuild }} + liveRuntimeDir: $(Build.SourcesDirectory)/artifacts/runtime + timeoutInMinutes: 360 + dependsOn: + - build_windows_x64_release_AllSubsets_CoreCLR + preBuildSteps: + - template: /eng/pipelines/common/download-artifact-step.yml + parameters: + artifactName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_coreclr + artifactFileName: BuildArtifacts_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_coreclr$(archiveExtension) + unpackFolder: $(Build.SourcesDirectory)/artifacts/runtime + displayName: 'Runtime Build Artifacts' + - powershell: Write-Host "##vso[task.setvariable variable=CDAC_DISABLE_FALLBACK]1" + postBuildSteps: + - task: PublishTestResults@2 + inputs: + testResultsFormat: xUnit + testResultsFiles: '**/*.xml' + searchFolder: '$(Build.SourcesDirectory)/artifacts/TestResults' + testRunTitle: 'Tests $(_PhaseName)' + failTaskOnFailedTests: true + publishRunAttachments: true + mergeTestResults: true + buildConfiguration: $(_BuildConfig) + continueOnError: true + condition: always() + diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataMethodInstance.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataMethodInstance.cs index ae823df64d721a..4f6699d6213ac9 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataMethodInstance.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataMethodInstance.cs @@ -33,10 +33,10 @@ public ClrDataMethodInstance( } int IXCLRDataMethodInstance.GetTypeInstance(void** typeInstance) - => _legacyImpl is not null ? _legacyImpl.GetTypeInstance(typeInstance) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetTypeInstance(typeInstance)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetDefinition(void** methodDefinition) - => _legacyImpl is not null ? _legacyImpl.GetDefinition(methodDefinition) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetDefinition(methodDefinition)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetTokenAndScope(uint* token, void** /*IXCLRDataModule*/ mod) { @@ -110,22 +110,22 @@ int IXCLRDataMethodInstance.GetTokenAndScope(uint* token, void** /*IXCLRDataModu } int IXCLRDataMethodInstance.GetName(uint flags, uint bufLen, uint* nameLen, char* nameBuf) - => _legacyImpl is not null ? _legacyImpl.GetName(flags, bufLen, nameLen, nameBuf) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetName(flags, bufLen, nameLen, nameBuf)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetFlags(uint* flags) - => _legacyImpl is not null ? _legacyImpl.GetFlags(flags) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFlags(flags)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.IsSameObject(IXCLRDataMethodInstance* method) - => _legacyImpl is not null ? _legacyImpl.IsSameObject(method) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.IsSameObject(method)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetEnCVersion(uint* version) - => _legacyImpl is not null ? _legacyImpl.GetEnCVersion(version) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetEnCVersion(version)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetNumTypeArguments(uint* numTypeArgs) - => _legacyImpl is not null ? _legacyImpl.GetNumTypeArguments(numTypeArgs) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetNumTypeArguments(numTypeArgs)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetTypeArgumentByIndex(uint index, void** typeArg) - => _legacyImpl is not null ? _legacyImpl.GetTypeArgumentByIndex(index, typeArg) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetTypeArgumentByIndex(index, typeArg)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetILOffsetsByAddress(ClrDataAddress address, uint offsetsLen, uint* offsetsNeeded, uint* ilOffsets) { @@ -211,22 +211,22 @@ int IXCLRDataMethodInstance.GetILOffsetsByAddress(ClrDataAddress address, uint o } int IXCLRDataMethodInstance.GetAddressRangesByILOffset(uint ilOffset, uint rangesLen, uint* rangesNeeded, void* addressRanges) - => _legacyImpl is not null ? _legacyImpl.GetAddressRangesByILOffset(ilOffset, rangesLen, rangesNeeded, addressRanges) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetAddressRangesByILOffset(ilOffset, rangesLen, rangesNeeded, addressRanges)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetILAddressMap(uint mapLen, uint* mapNeeded, void* maps) - => _legacyImpl is not null ? _legacyImpl.GetILAddressMap(mapLen, mapNeeded, maps) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetILAddressMap(mapLen, mapNeeded, maps)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.StartEnumExtents(ulong* handle) - => _legacyImpl is not null ? _legacyImpl.StartEnumExtents(handle) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.StartEnumExtents(handle)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.EnumExtent(ulong* handle, void* extent) - => _legacyImpl is not null ? _legacyImpl.EnumExtent(handle, extent) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.EnumExtent(handle, extent)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.EndEnumExtents(ulong handle) - => _legacyImpl is not null ? _legacyImpl.EndEnumExtents(handle) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.EndEnumExtents(handle)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.Request(uint reqCode, uint inBufferSize, byte* inBuffer, uint outBufferSize, byte* outBuffer) - => _legacyImpl is not null ? _legacyImpl.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer)) : HResults.E_NOTIMPL; int IXCLRDataMethodInstance.GetRepresentativeEntryAddress(ClrDataAddress* addr) { diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataModule.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataModule.cs index d000e9f67ad92c..fe444ad3c21885 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataModule.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataModule.cs @@ -61,72 +61,71 @@ CustomQueryInterfaceResult ICustomQueryInterface.GetInterface(ref Guid iid, out } int IXCLRDataModule.StartEnumAssemblies(ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumAssemblies(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumAssemblies(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumAssembly(ulong* handle, /*IXCLRDataAssembly*/ void** assembly) - => _legacyModule is not null ? _legacyModule.EnumAssembly(handle, assembly) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumAssembly(handle, assembly)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumAssemblies(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumAssemblies(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumAssemblies(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumTypeDefinitions(ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumTypeDefinitions(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumTypeDefinitions(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumTypeDefinition(ulong* handle, /*IXCLRDataTypeDefinition*/ void** typeDefinition) - => _legacyModule is not null ? _legacyModule.EnumTypeDefinition(handle, typeDefinition) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumTypeDefinition(handle, typeDefinition)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumTypeDefinitions(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumTypeDefinitions(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumTypeDefinitions(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumTypeInstances(/*IXCLRDataAppDomain*/ void* appDomain, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumTypeInstances(appDomain, handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumTypeInstances(appDomain, handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumTypeInstance(ulong* handle, /*IXCLRDataTypeInstance*/ void** typeInstance) - => _legacyModule is not null ? _legacyModule.EnumTypeInstance(handle, typeInstance) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumTypeInstance(handle, typeInstance)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumTypeInstances(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumTypeInstances(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumTypeInstances(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumTypeDefinitionsByName(char* name, uint flags, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumTypeDefinitionsByName(name, flags, handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumTypeDefinitionsByName(name, flags, handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumTypeDefinitionByName(ulong* handle, /*IXCLRDataTypeDefinition*/ void** type) - => _legacyModule is not null ? _legacyModule.EnumTypeDefinitionByName(handle, type) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumTypeDefinitionByName(handle, type)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumTypeDefinitionsByName(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumTypeDefinitionsByName(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumTypeDefinitionsByName(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumTypeInstancesByName(char* name, uint flags, /*IXCLRDataAppDomain*/ void* appDomain, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumTypeInstancesByName(name, flags, appDomain, handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumTypeInstancesByName(name, flags, appDomain, handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumTypeInstanceByName(ulong* handle, /*IXCLRDataTypeInstance*/ void** type) - => _legacyModule is not null ? _legacyModule.EnumTypeInstanceByName(handle, type) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumTypeInstanceByName(handle, type)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumTypeInstancesByName(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumTypeInstancesByName(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumTypeInstancesByName(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.GetTypeDefinitionByToken(/*mdTypeDef*/ uint token, /*IXCLRDataTypeDefinition*/ void** typeDefinition) - => _legacyModule is not null ? _legacyModule.GetTypeDefinitionByToken(token, typeDefinition) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.GetTypeDefinitionByToken(token, typeDefinition)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumMethodDefinitionsByName(char* name, uint flags, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumMethodDefinitionsByName(name, flags, handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumMethodDefinitionsByName(name, flags, handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumMethodDefinitionByName(ulong* handle, /*IXCLRDataMethodDefinition*/ void** method) - => _legacyModule is not null ? _legacyModule.EnumMethodDefinitionByName(handle, method) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumMethodDefinitionByName(handle, method)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumMethodDefinitionsByName(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumMethodDefinitionsByName(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumMethodDefinitionsByName(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumMethodInstancesByName(char* name, uint flags, /*IXCLRDataAppDomain*/ void* appDomain, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumMethodInstancesByName(name, flags, appDomain, handle) : HResults.E_NOTIMPL; - int IXCLRDataModule.EnumMethodInstanceByName(ulong* handle, out IXCLRDataMethodInstance? method) + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumMethodInstancesByName(name, flags, appDomain, handle)) : HResults.E_NOTIMPL; + int IXCLRDataModule.EnumMethodInstanceByName(ulong* handle, /*IXCLRDataMethodInstance*/ void** method) { - method = default; - return _legacyModule is not null ? _legacyModule.EnumMethodInstanceByName(handle, out method) : HResults.E_NOTIMPL; + return _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumMethodInstanceByName(handle, method)) : HResults.E_NOTIMPL; } int IXCLRDataModule.EndEnumMethodInstancesByName(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumMethodInstancesByName(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumMethodInstancesByName(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.GetMethodDefinitionByToken(/*mdMethodDef*/ uint token, /*IXCLRDataMethodDefinition*/ void** methodDefinition) - => _legacyModule is not null ? _legacyModule.GetMethodDefinitionByToken(token, methodDefinition) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.GetMethodDefinitionByToken(token, methodDefinition)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumDataByName(char* name, uint flags, /*IXCLRDataAppDomain*/ void* appDomain, /*IXCLRDataTask*/ void* tlsTask, ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumDataByName(name, flags, appDomain, tlsTask, handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumDataByName(name, flags, appDomain, tlsTask, handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumDataByName(ulong* handle, /*IXCLRDataValue*/ void** value) - => _legacyModule is not null ? _legacyModule.EnumDataByName(handle, value) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumDataByName(handle, value)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumDataByName(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumDataByName(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumDataByName(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.GetName(uint bufLen, uint* nameLen, char* name) - => _legacyModule is not null ? _legacyModule.GetName(bufLen, nameLen, name) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.GetName(bufLen, nameLen, name)) : HResults.E_NOTIMPL; int IXCLRDataModule.GetFileName(uint bufLen, uint* nameLen, char* name) { try @@ -215,7 +214,7 @@ int IXCLRDataModule.GetFlags(uint* flags) } int IXCLRDataModule.IsSameObject(IXCLRDataModule* mod) - => _legacyModule is not null ? _legacyModule.IsSameObject(mod) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.IsSameObject(mod)) : HResults.E_NOTIMPL; int IXCLRDataModule.StartEnumExtents(ulong* handle) { @@ -330,7 +329,7 @@ int IXCLRDataModule.Request(uint reqCode, uint inBufferSize, byte* inBuffer, uin return reqCode switch { 0xf0000001 /*DACDATAMODULEPRIV_REQUEST_GET_MODULEDATA*/ => DacPrivateRequestGetModuleData(inBufferSize, inBuffer, outBufferSize, outBuffer), - _ => _legacyModule is not null ? _legacyModule.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer) : HResults.E_NOTIMPL + _ => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer)) : HResults.E_NOTIMPL }; } @@ -411,15 +410,15 @@ private int DacPrivateRequestGetModuleData(uint inBufferSize, byte* inBuffer, ui } int IXCLRDataModule.StartEnumAppDomains(ulong* handle) - => _legacyModule is not null ? _legacyModule.StartEnumAppDomains(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.StartEnumAppDomains(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.EnumAppDomain(ulong* handle, /*IXCLRDataAppDomain*/ void** appDomain) - => _legacyModule is not null ? _legacyModule.EnumAppDomain(handle, appDomain) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EnumAppDomain(handle, appDomain)) : HResults.E_NOTIMPL; int IXCLRDataModule.EndEnumAppDomains(ulong handle) - => _legacyModule is not null ? _legacyModule.EndEnumAppDomains(handle) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.EndEnumAppDomains(handle)) : HResults.E_NOTIMPL; int IXCLRDataModule.GetVersionId(Guid* vid) - => _legacyModule is not null ? _legacyModule.GetVersionId(vid) : HResults.E_NOTIMPL; + => _legacyModule is not null ? FallbackHelper.Fallback(() => _legacyModule.GetVersionId(vid)) : HResults.E_NOTIMPL; int IXCLRDataModule2.SetJITCompilerFlags(uint flags) - => _legacyModule2 is not null ? _legacyModule2.SetJITCompilerFlags(flags) : HResults.E_NOTIMPL; + => _legacyModule2 is not null ? FallbackHelper.Fallback(() => _legacyModule2.SetJITCompilerFlags(flags)) : HResults.E_NOTIMPL; } diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataStackWalk.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataStackWalk.cs index 720d445fc3f2d4..6123bed0155314 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataStackWalk.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataStackWalk.cs @@ -85,11 +85,11 @@ int IXCLRDataStackWalk.GetContext(uint contextFlags, uint contextBufSize, uint* } int IXCLRDataStackWalk.GetFrame(void** frame) - => _legacyImpl is not null ? _legacyImpl.GetFrame(frame) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFrame(frame)) : HResults.E_NOTIMPL; int IXCLRDataStackWalk.GetFrameType(uint* simpleType, uint* detailedType) - => _legacyImpl is not null ? _legacyImpl.GetFrameType(simpleType, detailedType) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFrameType(simpleType, detailedType)) : HResults.E_NOTIMPL; int IXCLRDataStackWalk.GetStackSizeSkipped(ulong* stackSizeSkipped) - => _legacyImpl is not null ? _legacyImpl.GetStackSizeSkipped(stackSizeSkipped) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetStackSizeSkipped(stackSizeSkipped)) : HResults.E_NOTIMPL; int IXCLRDataStackWalk.Next() { int hr; @@ -156,7 +156,7 @@ int IXCLRDataStackWalk.Request(uint reqCode, uint inBufferSize, byte* inBuffer, return hr; } int IXCLRDataStackWalk.SetContext(uint contextSize, [In, MarshalUsing(CountElementName = "contextSize")] byte[] context) - => _legacyImpl is not null ? _legacyImpl.SetContext(contextSize, context) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.SetContext(contextSize, context)) : HResults.E_NOTIMPL; int IXCLRDataStackWalk.SetContext2(uint flags, uint contextSize, [In, MarshalUsing(CountElementName = "contextSize")] byte[] context) - => _legacyImpl is not null ? _legacyImpl.SetContext2(flags, contextSize, context) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.SetContext2(flags, contextSize, context)) : HResults.E_NOTIMPL; } diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataTask.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataTask.cs index 3c189701e57fd5..7bfc8fd7235da6 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataTask.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/ClrDataTask.cs @@ -21,21 +21,21 @@ public ClrDataTask(TargetPointer address, Target target, IXCLRDataTask? legacyIm } int IXCLRDataTask.GetProcess(/*IXCLRDataProcess*/ void** process) - => _legacyImpl is not null ? _legacyImpl.GetProcess(process) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetProcess(process)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetCurrentAppDomain(/*IXCLRDataAppDomain*/ void** appDomain) - => _legacyImpl is not null ? _legacyImpl.GetCurrentAppDomain(appDomain) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCurrentAppDomain(appDomain)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetUniqueID(ulong* id) - => _legacyImpl is not null ? _legacyImpl.GetUniqueID(id) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetUniqueID(id)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetFlags(uint* flags) - => _legacyImpl is not null ? _legacyImpl.GetFlags(flags) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFlags(flags)) : HResults.E_NOTIMPL; int IXCLRDataTask.IsSameObject(IXCLRDataTask* task) - => _legacyImpl is not null ? _legacyImpl.IsSameObject(task) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.IsSameObject(task)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetManagedObject(/*IXCLRDataValue*/ void** value) - => _legacyImpl is not null ? _legacyImpl.GetManagedObject(value) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetManagedObject(value)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetDesiredExecutionState(uint* state) - => _legacyImpl is not null ? _legacyImpl.GetDesiredExecutionState(state) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetDesiredExecutionState(state)) : HResults.E_NOTIMPL; int IXCLRDataTask.SetDesiredExecutionState(uint state) - => _legacyImpl is not null ? _legacyImpl.SetDesiredExecutionState(state) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.SetDesiredExecutionState(state)) : HResults.E_NOTIMPL; int IXCLRDataTask.CreateStackWalk(uint flags, out IXCLRDataStackWalk? stackWalk) { @@ -58,17 +58,17 @@ int IXCLRDataTask.CreateStackWalk(uint flags, out IXCLRDataStackWalk? stackWalk) } int IXCLRDataTask.GetOSThreadID(uint* id) - => _legacyImpl is not null ? _legacyImpl.GetOSThreadID(id) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetOSThreadID(id)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetContext(uint contextFlags, uint contextBufSize, uint* contextSize, byte* contextBuffer) - => _legacyImpl is not null ? _legacyImpl.GetContext(contextFlags, contextBufSize, contextSize, contextBuffer) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetContext(contextFlags, contextBufSize, contextSize, contextBuffer)) : HResults.E_NOTIMPL; int IXCLRDataTask.SetContext(uint contextSize, byte* context) - => _legacyImpl is not null ? _legacyImpl.SetContext(contextSize, context) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.SetContext(contextSize, context)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetCurrentExceptionState(/*IXCLRDataExceptionState*/ void** exception) - => _legacyImpl is not null ? _legacyImpl.GetCurrentExceptionState(exception) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCurrentExceptionState(exception)) : HResults.E_NOTIMPL; int IXCLRDataTask.Request(uint reqCode, uint inBufferSize, byte* inBuffer, uint outBufferSize, byte* outBuffer) - => _legacyImpl is not null ? _legacyImpl.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetName(uint bufLen, uint* nameLen, char* nameBuffer) - => _legacyImpl is not null ? _legacyImpl.GetName(bufLen, nameLen, nameBuffer) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetName(bufLen, nameLen, nameBuffer)) : HResults.E_NOTIMPL; int IXCLRDataTask.GetLastExceptionState(/*IXCLRDataExceptionState*/ void** exception) - => _legacyImpl is not null ? _legacyImpl.GetLastExceptionState(exception) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetLastExceptionState(exception)) : HResults.E_NOTIMPL; } diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/FallbackHelper.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/FallbackHelper.cs new file mode 100644 index 00000000000000..4a4c1bd3bade0b --- /dev/null +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/FallbackHelper.cs @@ -0,0 +1,23 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; + +namespace Microsoft.Diagnostics.DataContractReader.Legacy; + +internal static class FallbackHelper +{ + private const string CDAC_DISABLE_FALLBACK_ENV_VAR = "CDAC_DISABLE_FALLBACK"; + public static int Fallback(Func legacyImpl) + { + if (IsFallbackDisabled()) + { + return HResults.E_NOTIMPL; + } + + return legacyImpl(); + } + + private static bool IsFallbackDisabled() + => Environment.GetEnvironmentVariable(CDAC_DISABLE_FALLBACK_ENV_VAR) == "1"; +} diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/IXCLRData.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/IXCLRData.cs index e80aabc43f62bc..34176b73e087be 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/IXCLRData.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/IXCLRData.cs @@ -81,7 +81,7 @@ internal unsafe partial interface IXCLRDataModule [PreserveSig] int StartEnumMethodInstancesByName(char* name, uint flags, /*IXCLRDataAppDomain*/ void* appDomain, ulong* handle); [PreserveSig] - int EnumMethodInstanceByName(ulong* handle, out IXCLRDataMethodInstance? method); + int EnumMethodInstanceByName(ulong* handle, /*IXCLRDataMethodInstance*/ void** method); [PreserveSig] int EndEnumMethodInstancesByName(ulong handle); diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.ICLRDataEnumMemoryRegions.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.ICLRDataEnumMemoryRegions.cs index c0a327e21f969b..55545511828028 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.ICLRDataEnumMemoryRegions.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.ICLRDataEnumMemoryRegions.cs @@ -12,5 +12,5 @@ namespace Microsoft.Diagnostics.DataContractReader.Legacy; internal sealed unsafe partial class SOSDacImpl : ICLRDataEnumMemoryRegions { int ICLRDataEnumMemoryRegions.EnumMemoryRegions(void* callback, uint miniDumpFlags, int clrFlags) - => _legacyEnumMemory is not null ? _legacyEnumMemory.EnumMemoryRegions(callback, miniDumpFlags, clrFlags) : HResults.E_NOTIMPL; + => _legacyEnumMemory is not null ? FallbackHelper.Fallback(() => _legacyEnumMemory.EnumMemoryRegions(callback, miniDumpFlags, clrFlags)) : HResults.E_NOTIMPL; } diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.IXCLRDataProcess.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.IXCLRDataProcess.cs index 9ed85cd74c4eea..805082446b2f2d 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.IXCLRDataProcess.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.IXCLRDataProcess.cs @@ -30,13 +30,13 @@ int IXCLRDataProcess.Flush() } int IXCLRDataProcess.StartEnumTasks(ulong* handle) - => _legacyProcess is not null ? _legacyProcess.StartEnumTasks(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.StartEnumTasks(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EnumTask(ulong* handle, /*IXCLRDataTask*/ void** task) - => _legacyProcess is not null ? _legacyProcess.EnumTask(handle, task) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EnumTask(handle, task)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EndEnumTasks(ulong handle) - => _legacyProcess is not null ? _legacyProcess.EndEnumTasks(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EndEnumTasks(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetTaskByOSThreadID(uint osThreadID, out IXCLRDataTask? task) { @@ -74,25 +74,25 @@ int IXCLRDataProcess.GetTaskByOSThreadID(uint osThreadID, out IXCLRDataTask? tas } int IXCLRDataProcess.GetTaskByUniqueID(ulong taskID, /*IXCLRDataTask*/ void** task) - => _legacyProcess is not null ? _legacyProcess.GetTaskByUniqueID(taskID, task) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetTaskByUniqueID(taskID, task)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetFlags(uint* flags) - => _legacyProcess is not null ? _legacyProcess.GetFlags(flags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetFlags(flags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.IsSameObject(IXCLRDataProcess* process) - => _legacyProcess is not null ? _legacyProcess.IsSameObject(process) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.IsSameObject(process)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetManagedObject(/*IXCLRDataValue*/ void** value) - => _legacyProcess is not null ? _legacyProcess.GetManagedObject(value) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetManagedObject(value)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetDesiredExecutionState(uint* state) - => _legacyProcess is not null ? _legacyProcess.GetDesiredExecutionState(state) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetDesiredExecutionState(state)) : HResults.E_NOTIMPL; int IXCLRDataProcess.SetDesiredExecutionState(uint state) - => _legacyProcess is not null ? _legacyProcess.SetDesiredExecutionState(state) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.SetDesiredExecutionState(state)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetAddressType(ClrDataAddress address, /*CLRDataAddressType*/ uint* type) - => _legacyProcess is not null ? _legacyProcess.GetAddressType(address, type) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetAddressType(address, type)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetRuntimeNameByAddress( ClrDataAddress address, @@ -101,40 +101,40 @@ int IXCLRDataProcess.GetRuntimeNameByAddress( uint* nameLen, char* nameBuf, ClrDataAddress* displacement) - => _legacyProcess is not null ? _legacyProcess.GetRuntimeNameByAddress(address, flags, bufLen, nameLen, nameBuf, displacement) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetRuntimeNameByAddress(address, flags, bufLen, nameLen, nameBuf, displacement)) : HResults.E_NOTIMPL; int IXCLRDataProcess.StartEnumAppDomains(ulong* handle) - => _legacyProcess is not null ? _legacyProcess.StartEnumAppDomains(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.StartEnumAppDomains(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EnumAppDomain(ulong* handle, /*IXCLRDataAppDomain*/ void** appDomain) - => _legacyProcess is not null ? _legacyProcess.EnumAppDomain(handle, appDomain) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EnumAppDomain(handle, appDomain)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EndEnumAppDomains(ulong handle) - => _legacyProcess is not null ? _legacyProcess.EndEnumAppDomains(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EndEnumAppDomains(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetAppDomainByUniqueID(ulong id, /*IXCLRDataAppDomain*/ void** appDomain) - => _legacyProcess is not null ? _legacyProcess.GetAppDomainByUniqueID(id, appDomain) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetAppDomainByUniqueID(id, appDomain)) : HResults.E_NOTIMPL; int IXCLRDataProcess.StartEnumAssemblies(ulong* handle) - => _legacyProcess is not null ? _legacyProcess.StartEnumAssemblies(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.StartEnumAssemblies(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EnumAssembly(ulong* handle, /*IXCLRDataAssembly*/ void** assembly) - => _legacyProcess is not null ? _legacyProcess.EnumAssembly(handle, assembly) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EnumAssembly(handle, assembly)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EndEnumAssemblies(ulong handle) - => _legacyProcess is not null ? _legacyProcess.EndEnumAssemblies(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EndEnumAssemblies(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.StartEnumModules(ulong* handle) - => _legacyProcess is not null ? _legacyProcess.StartEnumModules(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.StartEnumModules(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EnumModule(ulong* handle, /*IXCLRDataModule*/ void** mod) - => _legacyProcess is not null ? _legacyProcess.EnumModule(handle, mod) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EnumModule(handle, mod)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EndEnumModules(ulong handle) - => _legacyProcess is not null ? _legacyProcess.EndEnumModules(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EndEnumModules(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetModuleByAddress(ClrDataAddress address, /*IXCLRDataModule*/ void** mod) - => _legacyProcess is not null ? _legacyProcess.GetModuleByAddress(address, mod) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetModuleByAddress(address, mod)) : HResults.E_NOTIMPL; internal class EnumMethodInstances { @@ -456,16 +456,16 @@ int IXCLRDataProcess.GetDataByAddress( char* nameBuf, /*IXCLRDataValue*/ void** value, ClrDataAddress* displacement) - => _legacyProcess is not null ? _legacyProcess.GetDataByAddress(address, flags, appDomain, tlsTask, bufLen, nameLen, nameBuf, value, displacement) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetDataByAddress(address, flags, appDomain, tlsTask, bufLen, nameLen, nameBuf, value, displacement)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetExceptionStateByExceptionRecord(/*struct EXCEPTION_RECORD64*/ void* record, /*IXCLRDataExceptionState*/ void** exState) - => _legacyProcess is not null ? _legacyProcess.GetExceptionStateByExceptionRecord(record, exState) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetExceptionStateByExceptionRecord(record, exState)) : HResults.E_NOTIMPL; int IXCLRDataProcess.TranslateExceptionRecordToNotification(/*struct EXCEPTION_RECORD64*/ void* record, /*IXCLRDataExceptionNotification*/ void* notify) - => _legacyProcess is not null ? _legacyProcess.TranslateExceptionRecordToNotification(record, notify) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.TranslateExceptionRecordToNotification(record, notify)) : HResults.E_NOTIMPL; int IXCLRDataProcess.Request(uint reqCode, uint inBufferSize, byte* inBuffer, uint outBufferSize, byte* outBuffer) - => _legacyProcess is not null ? _legacyProcess.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.Request(reqCode, inBufferSize, inBuffer, outBufferSize, outBuffer)) : HResults.E_NOTIMPL; int IXCLRDataProcess.CreateMemoryValue( /*IXCLRDataAppDomain*/ void* appDomain, @@ -473,13 +473,13 @@ int IXCLRDataProcess.CreateMemoryValue( /*IXCLRDataTypeInstance*/ void* type, ClrDataAddress addr, /*IXCLRDataValue*/ void** value) - => _legacyProcess is not null ? _legacyProcess.CreateMemoryValue(appDomain, tlsTask, type, addr, value) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.CreateMemoryValue(appDomain, tlsTask, type, addr, value)) : HResults.E_NOTIMPL; int IXCLRDataProcess.SetAllTypeNotifications(/*IXCLRDataModule*/ void* mod, uint flags) - => _legacyProcess is not null ? _legacyProcess.SetAllTypeNotifications(mod, flags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.SetAllTypeNotifications(mod, flags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.SetAllCodeNotifications(/*IXCLRDataModule*/ void* mod, uint flags) - => _legacyProcess is not null ? _legacyProcess.SetAllCodeNotifications(mod, flags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.SetAllCodeNotifications(mod, flags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetTypeNotifications( uint numTokens, @@ -487,7 +487,7 @@ int IXCLRDataProcess.GetTypeNotifications( /*IXCLRDataModule*/ void* singleMod, [In, MarshalUsing(CountElementName = nameof(numTokens))] /*mdTypeDef*/ uint[] tokens, [In, Out, MarshalUsing(CountElementName = nameof(numTokens))] uint[] flags) - => _legacyProcess is not null ? _legacyProcess.GetTypeNotifications(numTokens, mods, singleMod, tokens, flags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetTypeNotifications(numTokens, mods, singleMod, tokens, flags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.SetTypeNotifications( uint numTokens, @@ -496,7 +496,7 @@ int IXCLRDataProcess.SetTypeNotifications( [In, MarshalUsing(CountElementName = nameof(numTokens))] /*mdTypeDef*/ uint[] tokens, [In, MarshalUsing(CountElementName = nameof(numTokens))] uint[] flags, uint singleFlags) - => _legacyProcess is not null ? _legacyProcess.SetTypeNotifications(numTokens, mods, singleMod, tokens, flags, singleFlags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.SetTypeNotifications(numTokens, mods, singleMod, tokens, flags, singleFlags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetCodeNotifications( uint numTokens, @@ -504,7 +504,7 @@ int IXCLRDataProcess.GetCodeNotifications( /*IXCLRDataModule*/ void* singleMod, [In, MarshalUsing(CountElementName = nameof(numTokens))] /*mdMethodDef*/ uint[] tokens, [In, Out, MarshalUsing(CountElementName = nameof(numTokens))] uint[] flags) - => _legacyProcess is not null ? _legacyProcess.GetCodeNotifications(numTokens, mods, singleMod, tokens, flags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.GetCodeNotifications(numTokens, mods, singleMod, tokens, flags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.SetCodeNotifications( uint numTokens, @@ -513,7 +513,7 @@ int IXCLRDataProcess.SetCodeNotifications( [In, MarshalUsing(CountElementName = nameof(numTokens))] /*mdMethodDef */ uint[] tokens, [In, MarshalUsing(CountElementName = nameof(numTokens))] uint[] flags, uint singleFlags) - => _legacyProcess is not null ? _legacyProcess.SetCodeNotifications(numTokens, mods, singleMod, tokens, flags, singleFlags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.SetCodeNotifications(numTokens, mods, singleMod, tokens, flags, singleFlags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.GetOtherNotificationFlags(uint* flags) { @@ -589,13 +589,13 @@ int IXCLRDataProcess.SetOtherNotificationFlags(uint flags) } int IXCLRDataProcess.StartEnumMethodDefinitionsByAddress(ClrDataAddress address, ulong* handle) - => _legacyProcess is not null ? _legacyProcess.StartEnumMethodDefinitionsByAddress(address, handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.StartEnumMethodDefinitionsByAddress(address, handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EnumMethodDefinitionByAddress(ulong* handle, /*IXCLRDataMethodDefinition*/ void** method) - => _legacyProcess is not null ? _legacyProcess.EnumMethodDefinitionByAddress(handle, method) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EnumMethodDefinitionByAddress(handle, method)) : HResults.E_NOTIMPL; int IXCLRDataProcess.EndEnumMethodDefinitionsByAddress(ulong handle) - => _legacyProcess is not null ? _legacyProcess.EndEnumMethodDefinitionsByAddress(handle) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.EndEnumMethodDefinitionsByAddress(handle)) : HResults.E_NOTIMPL; int IXCLRDataProcess.FollowStub( uint inFlags, @@ -604,7 +604,7 @@ int IXCLRDataProcess.FollowStub( ClrDataAddress* outAddr, /*struct CLRDATA_FOLLOW_STUB_BUFFER*/ void* outBuffer, uint* outFlags) - => _legacyProcess is not null ? _legacyProcess.FollowStub(inFlags, inAddr, inBuffer, outAddr, outBuffer, outFlags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.FollowStub(inFlags, inAddr, inBuffer, outAddr, outBuffer, outFlags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.FollowStub2( /*IXCLRDataTask*/ void* task, @@ -614,7 +614,7 @@ int IXCLRDataProcess.FollowStub2( ClrDataAddress* outAddr, /*struct CLRDATA_FOLLOW_STUB_BUFFER*/ void* outBuffer, uint* outFlags) - => _legacyProcess is not null ? _legacyProcess.FollowStub2(task, inFlags, inAddr, inBuffer, outAddr, outBuffer, outFlags) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.FollowStub2(task, inFlags, inAddr, inBuffer, outAddr, outBuffer, outFlags)) : HResults.E_NOTIMPL; int IXCLRDataProcess.DumpNativeImage( ClrDataAddress loadedBase, @@ -622,11 +622,11 @@ int IXCLRDataProcess.DumpNativeImage( /*IXCLRDataDisplay*/ void* display, /*IXCLRLibrarySupport*/ void* libSupport, /*IXCLRDisassemblySupport*/ void* dis) - => _legacyProcess is not null ? _legacyProcess.DumpNativeImage(loadedBase, name, display, libSupport, dis) : HResults.E_NOTIMPL; + => _legacyProcess is not null ? FallbackHelper.Fallback(() => _legacyProcess.DumpNativeImage(loadedBase, name, display, libSupport, dis)) : HResults.E_NOTIMPL; int IXCLRDataProcess2.GetGcNotification(GcEvtArgs* gcEvtArgs) - => _legacyProcess2 is not null ? _legacyProcess2.GetGcNotification(gcEvtArgs) : HResults.E_NOTIMPL; + => _legacyProcess2 is not null ? FallbackHelper.Fallback(() => _legacyProcess2.GetGcNotification(gcEvtArgs)) : HResults.E_NOTIMPL; int IXCLRDataProcess2.SetGcNotification(GcEvtArgs gcEvtArgs) - => _legacyProcess2 is not null ? _legacyProcess2.SetGcNotification(gcEvtArgs) : HResults.E_NOTIMPL; + => _legacyProcess2 is not null ? FallbackHelper.Fallback(() => _legacyProcess2.SetGcNotification(gcEvtArgs)) : HResults.E_NOTIMPL; } diff --git a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs index ea56a52440ee2e..773d6ec21c58e2 100644 --- a/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs +++ b/src/native/managed/cdac/mscordaccore_universal/Legacy/SOSDacImpl.cs @@ -479,7 +479,7 @@ int ISOSDacInterface.GetAssemblyList(ClrDataAddress addr, int count, [In, Marsha return hr; } int ISOSDacInterface.GetAssemblyLocation(ClrDataAddress assembly, int count, char* location, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetAssemblyLocation(assembly, count, location, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetAssemblyLocation(assembly, count, location, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetAssemblyModuleList(ClrDataAddress assembly, uint count, [In, MarshalUsing(CountElementName = "count"), Out] ClrDataAddress[]? modules, uint* pNeeded) { if (assembly == 0) @@ -577,17 +577,17 @@ int ISOSDacInterface.GetAssemblyName(ClrDataAddress assembly, uint count, char* return hr; } int ISOSDacInterface.GetCCWData(ClrDataAddress ccw, void* data) - => _legacyImpl is not null ? _legacyImpl.GetCCWData(ccw, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCCWData(ccw, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetCCWInterfaces(ClrDataAddress ccw, uint count, void* interfaces, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetCCWInterfaces(ccw, count, interfaces, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCCWInterfaces(ccw, count, interfaces, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetClrWatsonBuckets(ClrDataAddress thread, void* pGenericModeBlock) - => _legacyImpl is not null ? _legacyImpl.GetClrWatsonBuckets(thread, pGenericModeBlock) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetClrWatsonBuckets(thread, pGenericModeBlock)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetCodeHeaderData(ClrDataAddress ip, void* data) - => _legacyImpl is not null ? _legacyImpl.GetCodeHeaderData(ip, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCodeHeaderData(ip, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetCodeHeapList(ClrDataAddress jitManager, uint count, void* codeHeaps, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetCodeHeapList(jitManager, count, codeHeaps, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetCodeHeapList(jitManager, count, codeHeaps, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetDacModuleHandle(void* phModule) - => _legacyImpl is not null ? _legacyImpl.GetDacModuleHandle(phModule) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetDacModuleHandle(phModule)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetDomainFromContext(ClrDataAddress context, ClrDataAddress* domain) { int hr = HResults.S_OK; @@ -664,15 +664,15 @@ int ISOSDacInterface.GetDomainLocalModuleDataFromModule(ClrDataAddress moduleAdd return hr; } int ISOSDacInterface.GetFailedAssemblyData(ClrDataAddress assembly, uint* pContext, int* pResult) - => _legacyImpl is not null ? _legacyImpl.GetFailedAssemblyData(assembly, pContext, pResult) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFailedAssemblyData(assembly, pContext, pResult)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetFailedAssemblyDisplayName(ClrDataAddress assembly, uint count, char* name, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetFailedAssemblyDisplayName(assembly, count, name, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFailedAssemblyDisplayName(assembly, count, name, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetFailedAssemblyList(ClrDataAddress appDomain, int count, [In, MarshalUsing(CountElementName = "count"), Out] ClrDataAddress[] values, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetFailedAssemblyList(appDomain, count, values, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFailedAssemblyList(appDomain, count, values, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetFailedAssemblyLocation(ClrDataAddress assesmbly, uint count, char* location, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetFailedAssemblyLocation(assesmbly, count, location, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFailedAssemblyLocation(assesmbly, count, location, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetFieldDescData(ClrDataAddress fieldDesc, void* data) - => _legacyImpl is not null ? _legacyImpl.GetFieldDescData(fieldDesc, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetFieldDescData(fieldDesc, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetFrameName(ClrDataAddress vtable, uint count, char* frameName, uint* pNeeded) { if (vtable == 0) @@ -725,6 +725,7 @@ int ISOSDacInterface.GetFrameName(ClrDataAddress vtable, uint count, char* frame return hr; } + int ISOSDacInterface.GetGCHeapData(DacpGcHeapData* data) { int hr = HResults.S_OK; @@ -837,23 +838,23 @@ int ISOSDacInterface.GetGCHeapList(uint count, [In, MarshalUsing(CountElementNam return hr; } int ISOSDacInterface.GetGCHeapDetails(ClrDataAddress heap, void* details) - => _legacyImpl is not null ? _legacyImpl.GetGCHeapDetails(heap, details) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetGCHeapDetails(heap, details)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetGCHeapStaticData(void* data) - => _legacyImpl is not null ? _legacyImpl.GetGCHeapStaticData(data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetGCHeapStaticData(data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHandleEnum(void** ppHandleEnum) - => _legacyImpl is not null ? _legacyImpl.GetHandleEnum(ppHandleEnum) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHandleEnum(ppHandleEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHandleEnumForGC(uint gen, void** ppHandleEnum) - => _legacyImpl is not null ? _legacyImpl.GetHandleEnumForGC(gen, ppHandleEnum) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHandleEnumForGC(gen, ppHandleEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHandleEnumForTypes([In, MarshalUsing(CountElementName = "count")] uint[] types, uint count, void** ppHandleEnum) - => _legacyImpl is not null ? _legacyImpl.GetHandleEnumForTypes(types, count, ppHandleEnum) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHandleEnumForTypes(types, count, ppHandleEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHeapAllocData(uint count, void* data, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetHeapAllocData(count, data, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHeapAllocData(count, data, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHeapAnalyzeData(ClrDataAddress addr, void* data) - => _legacyImpl is not null ? _legacyImpl.GetHeapAnalyzeData(addr, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHeapAnalyzeData(addr, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHeapAnalyzeStaticData(void* data) - => _legacyImpl is not null ? _legacyImpl.GetHeapAnalyzeStaticData(data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHeapAnalyzeStaticData(data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHeapSegmentData(ClrDataAddress seg, void* data) - => _legacyImpl is not null ? _legacyImpl.GetHeapSegmentData(seg, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetHeapSegmentData(seg, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetHillClimbingLogEntry(ClrDataAddress addr, void* data) { @@ -909,9 +910,9 @@ int ISOSDacInterface.GetILForModule(ClrDataAddress moduleAddr, int rva, ClrDataA return hr; } int ISOSDacInterface.GetJitHelperFunctionName(ClrDataAddress ip, uint count, byte* name, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetJitHelperFunctionName(ip, count, name, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetJitHelperFunctionName(ip, count, name, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetJitManagerList(uint count, void* managers, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetJitManagerList(count, managers, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetJitManagerList(count, managers, pNeeded)) : HResults.E_NOTIMPL; private bool IsJumpRel64(TargetPointer pThunk) => 0x48 == _target.Read(pThunk) && @@ -1739,7 +1740,7 @@ int ISOSDacInterface.GetMethodTableName(ClrDataAddress mt, uint count, char* mtN } int ISOSDacInterface.GetMethodTableSlot(ClrDataAddress mt, uint slot, ClrDataAddress* value) - => _legacyImpl is not null ? _legacyImpl.GetMethodTableSlot(mt, slot, value) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetMethodTableSlot(mt, slot, value)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetMethodTableTransparencyData(ClrDataAddress mt, DacpMethodTableTransparencyData* data) { @@ -1912,7 +1913,7 @@ int ISOSDacInterface.GetNestedExceptionData(ClrDataAddress exception, ClrDataAdd } int ISOSDacInterface.GetObjectClassName(ClrDataAddress obj, uint count, char* className, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetObjectClassName(obj, count, className, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetObjectClassName(obj, count, className, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetObjectData(ClrDataAddress objAddr, DacpObjectData* data) { @@ -2065,9 +2066,9 @@ int ISOSDacInterface.GetObjectStringData(ClrDataAddress obj, uint count, char* s } int ISOSDacInterface.GetOOMData(ClrDataAddress oomAddr, void* data) - => _legacyImpl is not null ? _legacyImpl.GetOOMData(oomAddr, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetOOMData(oomAddr, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetOOMStaticData(void* data) - => _legacyImpl is not null ? _legacyImpl.GetOOMStaticData(data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetOOMStaticData(data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetPEFileBase(ClrDataAddress addr, ClrDataAddress* peBase) { @@ -2174,15 +2175,15 @@ int ISOSDacInterface.GetPrivateBinPaths(ClrDataAddress appDomain, int count, cha return hr; } int ISOSDacInterface.GetRCWData(ClrDataAddress addr, void* data) - => _legacyImpl is not null ? _legacyImpl.GetRCWData(addr, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetRCWData(addr, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetRCWInterfaces(ClrDataAddress rcw, uint count, void* interfaces, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetRCWInterfaces(rcw, count, interfaces, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetRCWInterfaces(rcw, count, interfaces, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetRegisterName(int regName, uint count, char* buffer, uint* pNeeded) - => _legacyImpl is not null ? _legacyImpl.GetRegisterName(regName, count, buffer, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetRegisterName(regName, count, buffer, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetStackLimits(ClrDataAddress threadPtr, ClrDataAddress* lower, ClrDataAddress* upper, ClrDataAddress* fp) - => _legacyImpl is not null ? _legacyImpl.GetStackLimits(threadPtr, lower, upper, fp) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetStackLimits(threadPtr, lower, upper, fp)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetStackReferences(int osThreadID, void** ppEnum) - => _legacyImpl is not null ? _legacyImpl.GetStackReferences(osThreadID, ppEnum) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetStackReferences(osThreadID, ppEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetStressLogAddress(ClrDataAddress* stressLog) { @@ -2201,11 +2202,11 @@ int ISOSDacInterface.GetStressLogAddress(ClrDataAddress* stressLog) } int ISOSDacInterface.GetSyncBlockCleanupData(ClrDataAddress addr, void* data) - => _legacyImpl is not null ? _legacyImpl.GetSyncBlockCleanupData(addr, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetSyncBlockCleanupData(addr, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetSyncBlockData(uint number, void* data) - => _legacyImpl is not null ? _legacyImpl.GetSyncBlockData(number, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetSyncBlockData(number, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetThreadAllocData(ClrDataAddress thread, void* data) - => _legacyImpl is not null ? _legacyImpl.GetThreadAllocData(thread, data) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.GetThreadAllocData(thread, data)) : HResults.E_NOTIMPL; int ISOSDacInterface.GetThreadData(ClrDataAddress thread, DacpThreadData* data) { @@ -2490,9 +2491,9 @@ int ISOSDacInterface.GetWorkRequestData(ClrDataAddress addrWorkRequest, void* da return hr; } int ISOSDacInterface.TraverseEHInfo(ClrDataAddress ip, void* pCallback, void* token) - => _legacyImpl is not null ? _legacyImpl.TraverseEHInfo(ip, pCallback, token) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.TraverseEHInfo(ip, pCallback, token)) : HResults.E_NOTIMPL; int ISOSDacInterface.TraverseLoaderHeap(ClrDataAddress loaderHeapAddr, void* pCallback) - => _legacyImpl is not null ? _legacyImpl.TraverseLoaderHeap(loaderHeapAddr, pCallback) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.TraverseLoaderHeap(loaderHeapAddr, pCallback)) : HResults.E_NOTIMPL; #if DEBUG [UnmanagedCallersOnly(CallConvs = new[] { typeof(CallConvStdcall) })] @@ -2566,9 +2567,9 @@ int ISOSDacInterface.TraverseModuleMap(ModuleMapType mmt, ClrDataAddress moduleA return hr; } int ISOSDacInterface.TraverseRCWCleanupList(ClrDataAddress cleanupListPtr, void* pCallback, void* token) - => _legacyImpl is not null ? _legacyImpl.TraverseRCWCleanupList(cleanupListPtr, pCallback, token) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.TraverseRCWCleanupList(cleanupListPtr, pCallback, token)) : HResults.E_NOTIMPL; int ISOSDacInterface.TraverseVirtCallStubHeap(ClrDataAddress pAppDomain, int heaptype, void* pCallback) - => _legacyImpl is not null ? _legacyImpl.TraverseVirtCallStubHeap(pAppDomain, heaptype, pCallback) : HResults.E_NOTIMPL; + => _legacyImpl is not null ? FallbackHelper.Fallback(() => _legacyImpl.TraverseVirtCallStubHeap(pAppDomain, heaptype, pCallback)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface #region ISOSDacInterface2 @@ -2596,16 +2597,16 @@ int ISOSDacInterface2.GetObjectExceptionData(ClrDataAddress objectAddress, DacpE } int ISOSDacInterface2.IsRCWDCOMProxy(ClrDataAddress rcwAddress, int* inDCOMProxy) - => _legacyImpl2 is not null ? _legacyImpl2.IsRCWDCOMProxy(rcwAddress, inDCOMProxy) : HResults.E_NOTIMPL; + => _legacyImpl2 is not null ? FallbackHelper.Fallback(() => _legacyImpl2.IsRCWDCOMProxy(rcwAddress, inDCOMProxy)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface2 #region ISOSDacInterface3 int ISOSDacInterface3.GetGCInterestingInfoData(ClrDataAddress interestingInfoAddr, /*struct DacpGCInterestingInfoData*/ void* data) - => _legacyImpl3 is not null ? _legacyImpl3.GetGCInterestingInfoData(interestingInfoAddr, data) : HResults.E_NOTIMPL; + => _legacyImpl3 is not null ? FallbackHelper.Fallback(() => _legacyImpl3.GetGCInterestingInfoData(interestingInfoAddr, data)) : HResults.E_NOTIMPL; int ISOSDacInterface3.GetGCInterestingInfoStaticData(/*struct DacpGCInterestingInfoData*/ void* data) - => _legacyImpl3 is not null ? _legacyImpl3.GetGCInterestingInfoStaticData(data) : HResults.E_NOTIMPL; + => _legacyImpl3 is not null ? FallbackHelper.Fallback(() => _legacyImpl3.GetGCInterestingInfoStaticData(data)) : HResults.E_NOTIMPL; int ISOSDacInterface3.GetGCGlobalMechanisms(nuint* globalMechanisms) - => _legacyImpl3 is not null ? _legacyImpl3.GetGCGlobalMechanisms(globalMechanisms) : HResults.E_NOTIMPL; + => _legacyImpl3 is not null ? FallbackHelper.Fallback(() => _legacyImpl3.GetGCGlobalMechanisms(globalMechanisms)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface3 #region ISOSDacInterface4 @@ -2652,12 +2653,12 @@ int ISOSDacInterface4.GetClrNotification(ClrDataAddress[] arguments, int count, #region ISOSDacInterface5 int ISOSDacInterface5.GetTieredVersions(ClrDataAddress methodDesc, int rejitId, /*struct DacpTieredVersionData*/ void* nativeCodeAddrs, int cNativeCodeAddrs, int* pcNativeCodeAddrs) - => _legacyImpl5 is not null ? _legacyImpl5.GetTieredVersions(methodDesc, rejitId, nativeCodeAddrs, cNativeCodeAddrs, pcNativeCodeAddrs) : HResults.E_NOTIMPL; + => _legacyImpl5 is not null ? FallbackHelper.Fallback(() => _legacyImpl5.GetTieredVersions(methodDesc, rejitId, nativeCodeAddrs, cNativeCodeAddrs, pcNativeCodeAddrs)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface5 #region ISOSDacInterface6 int ISOSDacInterface6.GetMethodTableCollectibleData(ClrDataAddress mt, /*struct DacpMethodTableCollectibleData*/ void* data) - => _legacyImpl6 is not null ? _legacyImpl6.GetMethodTableCollectibleData(mt, data) : HResults.E_NOTIMPL; + => _legacyImpl6 is not null ? FallbackHelper.Fallback(() => _legacyImpl6.GetMethodTableCollectibleData(mt, data)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface6 #region ISOSDacInterface7 @@ -2703,28 +2704,28 @@ int ISOSDacInterface7.GetPendingReJITID(ClrDataAddress methodDesc, int* pRejitId return hr; } int ISOSDacInterface7.GetReJITInformation(ClrDataAddress methodDesc, int rejitId, /*struct DacpReJitData2*/ void* pRejitData) - => _legacyImpl7 is not null ? _legacyImpl7.GetReJITInformation(methodDesc, rejitId, pRejitData) : HResults.E_NOTIMPL; + => _legacyImpl7 is not null ? FallbackHelper.Fallback(() => _legacyImpl7.GetReJITInformation(methodDesc, rejitId, pRejitData)) : HResults.E_NOTIMPL; int ISOSDacInterface7.GetProfilerModifiedILInformation(ClrDataAddress methodDesc, /*struct DacpProfilerILData*/ void* pILData) - => _legacyImpl7 is not null ? _legacyImpl7.GetProfilerModifiedILInformation(methodDesc, pILData) : HResults.E_NOTIMPL; + => _legacyImpl7 is not null ? FallbackHelper.Fallback(() => _legacyImpl7.GetProfilerModifiedILInformation(methodDesc, pILData)) : HResults.E_NOTIMPL; int ISOSDacInterface7.GetMethodsWithProfilerModifiedIL(ClrDataAddress mod, ClrDataAddress* methodDescs, int cMethodDescs, int* pcMethodDescs) - => _legacyImpl7 is not null ? _legacyImpl7.GetMethodsWithProfilerModifiedIL(mod, methodDescs, cMethodDescs, pcMethodDescs) : HResults.E_NOTIMPL; + => _legacyImpl7 is not null ? FallbackHelper.Fallback(() => _legacyImpl7.GetMethodsWithProfilerModifiedIL(mod, methodDescs, cMethodDescs, pcMethodDescs)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface7 #region ISOSDacInterface8 int ISOSDacInterface8.GetNumberGenerations(uint* pGenerations) - => _legacyImpl8 is not null ? _legacyImpl8.GetNumberGenerations(pGenerations) : HResults.E_NOTIMPL; + => _legacyImpl8 is not null ? FallbackHelper.Fallback(() => _legacyImpl8.GetNumberGenerations(pGenerations)) : HResults.E_NOTIMPL; // WKS int ISOSDacInterface8.GetGenerationTable(uint cGenerations, /*struct DacpGenerationData*/ void* pGenerationData, uint* pNeeded) - => _legacyImpl8 is not null ? _legacyImpl8.GetGenerationTable(cGenerations, pGenerationData, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl8 is not null ? FallbackHelper.Fallback(() => _legacyImpl8.GetGenerationTable(cGenerations, pGenerationData, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface8.GetFinalizationFillPointers(uint cFillPointers, ClrDataAddress* pFinalizationFillPointers, uint* pNeeded) - => _legacyImpl8 is not null ? _legacyImpl8.GetFinalizationFillPointers(cFillPointers, pFinalizationFillPointers, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl8 is not null ? FallbackHelper.Fallback(() => _legacyImpl8.GetFinalizationFillPointers(cFillPointers, pFinalizationFillPointers, pNeeded)) : HResults.E_NOTIMPL; // SVR int ISOSDacInterface8.GetGenerationTableSvr(ClrDataAddress heapAddr, uint cGenerations, /*struct DacpGenerationData*/ void* pGenerationData, uint* pNeeded) - => _legacyImpl8 is not null ? _legacyImpl8.GetGenerationTableSvr(heapAddr, cGenerations, pGenerationData, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl8 is not null ? FallbackHelper.Fallback(() => _legacyImpl8.GetGenerationTableSvr(heapAddr, cGenerations, pGenerationData, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface8.GetFinalizationFillPointersSvr(ClrDataAddress heapAddr, uint cFillPointers, ClrDataAddress* pFinalizationFillPointers, uint* pNeeded) - => _legacyImpl8 is not null ? _legacyImpl8.GetFinalizationFillPointersSvr(heapAddr, cFillPointers, pFinalizationFillPointers, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl8 is not null ? FallbackHelper.Fallback(() => _legacyImpl8.GetFinalizationFillPointersSvr(heapAddr, cFillPointers, pFinalizationFillPointers, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface8.GetAssemblyLoadContext(ClrDataAddress methodTable, ClrDataAddress* assemblyLoadContext) { @@ -2778,46 +2779,46 @@ int ISOSDacInterface9.GetBreakingChangeVersion() #region ISOSDacInterface10 int ISOSDacInterface10.GetObjectComWrappersData(ClrDataAddress objAddr, ClrDataAddress* rcw, uint count, ClrDataAddress* mowList, uint* pNeeded) - => _legacyImpl10 is not null ? _legacyImpl10.GetObjectComWrappersData(objAddr, rcw, count, mowList, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl10 is not null ? FallbackHelper.Fallback(() => _legacyImpl10.GetObjectComWrappersData(objAddr, rcw, count, mowList, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface10.IsComWrappersCCW(ClrDataAddress ccw, Interop.BOOL* isComWrappersCCW) - => _legacyImpl10 is not null ? _legacyImpl10.IsComWrappersCCW(ccw, isComWrappersCCW) : HResults.E_NOTIMPL; + => _legacyImpl10 is not null ? FallbackHelper.Fallback(() => _legacyImpl10.IsComWrappersCCW(ccw, isComWrappersCCW)) : HResults.E_NOTIMPL; int ISOSDacInterface10.GetComWrappersCCWData(ClrDataAddress ccw, ClrDataAddress* managedObject, int* refCount) - => _legacyImpl10 is not null ? _legacyImpl10.GetComWrappersCCWData(ccw, managedObject, refCount) : HResults.E_NOTIMPL; + => _legacyImpl10 is not null ? FallbackHelper.Fallback(() => _legacyImpl10.GetComWrappersCCWData(ccw, managedObject, refCount)) : HResults.E_NOTIMPL; int ISOSDacInterface10.IsComWrappersRCW(ClrDataAddress rcw, Interop.BOOL* isComWrappersRCW) - => _legacyImpl10 is not null ? _legacyImpl10.IsComWrappersRCW(rcw, isComWrappersRCW) : HResults.E_NOTIMPL; + => _legacyImpl10 is not null ? FallbackHelper.Fallback(() => _legacyImpl10.IsComWrappersRCW(rcw, isComWrappersRCW)) : HResults.E_NOTIMPL; int ISOSDacInterface10.GetComWrappersRCWData(ClrDataAddress rcw, ClrDataAddress* identity) - => _legacyImpl10 is not null ? _legacyImpl10.GetComWrappersRCWData(rcw, identity) : HResults.E_NOTIMPL; + => _legacyImpl10 is not null ? FallbackHelper.Fallback(() => _legacyImpl10.GetComWrappersRCWData(rcw, identity)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface10 #region ISOSDacInterface11 int ISOSDacInterface11.IsTrackedType(ClrDataAddress objAddr, Interop.BOOL* isTrackedType, Interop.BOOL* hasTaggedMemory) - => _legacyImpl11 is not null ? _legacyImpl11.IsTrackedType(objAddr, isTrackedType, hasTaggedMemory) : HResults.E_NOTIMPL; + => _legacyImpl11 is not null ? FallbackHelper.Fallback(() => _legacyImpl11.IsTrackedType(objAddr, isTrackedType, hasTaggedMemory)) : HResults.E_NOTIMPL; int ISOSDacInterface11.GetTaggedMemory(ClrDataAddress objAddr, ClrDataAddress* taggedMemory, nuint* taggedMemorySizeInBytes) - => _legacyImpl11 is not null ? _legacyImpl11.GetTaggedMemory(objAddr, taggedMemory, taggedMemorySizeInBytes) : HResults.E_NOTIMPL; + => _legacyImpl11 is not null ? FallbackHelper.Fallback(() => _legacyImpl11.GetTaggedMemory(objAddr, taggedMemory, taggedMemorySizeInBytes)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface11 #region ISOSDacInterface12 int ISOSDacInterface12.GetGlobalAllocationContext(ClrDataAddress* allocPtr, ClrDataAddress* allocLimit) - => _legacyImpl12 is not null ? _legacyImpl12.GetGlobalAllocationContext(allocPtr, allocLimit) : HResults.E_NOTIMPL; + => _legacyImpl12 is not null ? FallbackHelper.Fallback(() => _legacyImpl12.GetGlobalAllocationContext(allocPtr, allocLimit)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface12 #region ISOSDacInterface13 int ISOSDacInterface13.TraverseLoaderHeap(ClrDataAddress loaderHeapAddr, /*LoaderHeapKind*/ int kind, /*VISITHEAP*/ delegate* unmanaged pCallback) - => _legacyImpl13 is not null ? _legacyImpl13.TraverseLoaderHeap(loaderHeapAddr, kind, pCallback) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.TraverseLoaderHeap(loaderHeapAddr, kind, pCallback)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetDomainLoaderAllocator(ClrDataAddress domainAddress, ClrDataAddress* pLoaderAllocator) - => _legacyImpl13 is not null ? _legacyImpl13.GetDomainLoaderAllocator(domainAddress, pLoaderAllocator) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetDomainLoaderAllocator(domainAddress, pLoaderAllocator)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetLoaderAllocatorHeapNames(int count, char** ppNames, int* pNeeded) - => _legacyImpl13 is not null ? _legacyImpl13.GetLoaderAllocatorHeapNames(count, ppNames, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetLoaderAllocatorHeapNames(count, ppNames, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetLoaderAllocatorHeaps(ClrDataAddress loaderAllocator, int count, ClrDataAddress* pLoaderHeaps, /*LoaderHeapKind*/ int* pKinds, int* pNeeded) - => _legacyImpl13 is not null ? _legacyImpl13.GetLoaderAllocatorHeaps(loaderAllocator, count, pLoaderHeaps, pKinds, pNeeded) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetLoaderAllocatorHeaps(loaderAllocator, count, pLoaderHeaps, pKinds, pNeeded)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetHandleTableMemoryRegions(/*ISOSMemoryEnum*/ void** ppEnum) - => _legacyImpl13 is not null ? _legacyImpl13.GetHandleTableMemoryRegions(ppEnum) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetHandleTableMemoryRegions(ppEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetGCBookkeepingMemoryRegions(/*ISOSMemoryEnum*/ void** ppEnum) - => _legacyImpl13 is not null ? _legacyImpl13.GetGCBookkeepingMemoryRegions(ppEnum) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetGCBookkeepingMemoryRegions(ppEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface13.GetGCFreeRegions(/*ISOSMemoryEnum*/ void** ppEnum) - => _legacyImpl13 is not null ? _legacyImpl13.GetGCFreeRegions(ppEnum) : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.GetGCFreeRegions(ppEnum)) : HResults.E_NOTIMPL; int ISOSDacInterface13.LockedFlush() - => _legacyImpl13 is not null ? _legacyImpl13.LockedFlush() : HResults.E_NOTIMPL; + => _legacyImpl13 is not null ? FallbackHelper.Fallback(() => _legacyImpl13.LockedFlush()) : HResults.E_NOTIMPL; #endregion ISOSDacInterface13 #region ISOSDacInterface14 @@ -2963,11 +2964,11 @@ int ISOSDacInterface14.GetMethodTableInitializationFlags(ClrDataAddress methodTa #region ISOSDacInterface15 int ISOSDacInterface15.GetMethodTableSlotEnumerator(ClrDataAddress mt, /*ISOSMethodEnum*/void** enumerator) - => _legacyImpl15 is not null ? _legacyImpl15.GetMethodTableSlotEnumerator(mt, enumerator) : HResults.E_NOTIMPL; + => _legacyImpl15 is not null ? FallbackHelper.Fallback(() => _legacyImpl15.GetMethodTableSlotEnumerator(mt, enumerator)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface15 #region ISOSDacInterface16 int ISOSDacInterface16.GetGCDynamicAdaptationMode(int* pDynamicAdaptationMode) - => _legacyImpl16 is not null ? _legacyImpl16.GetGCDynamicAdaptationMode(pDynamicAdaptationMode) : HResults.E_NOTIMPL; + => _legacyImpl16 is not null ? FallbackHelper.Fallback(() => _legacyImpl16.GetGCDynamicAdaptationMode(pDynamicAdaptationMode)) : HResults.E_NOTIMPL; #endregion ISOSDacInterface16 }