Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[cDAC] Implement 'no-op' ISOSDacInterface methods #115207

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

Merged
merged 1 commit into from
May 1, 2025

Conversation

max-charlamb
Copy link
Contributor

@max-charlamb max-charlamb commented Apr 30, 2025

Quick pass going through methods which the DAC does not implement. I matched the error code returned by the DAC implementation.

ISOSDacInterface::GetThreadpoolData
ISOSDacInterface::GetWorkRequestData
ISOSDacInterface::GetHillClimbingLogEntry
ISOSDacInterface::GetDomainLocalModuleData
ISOSDacInterface::GetDomainLocalModuleDataFromAppDomain
ISOSDacInterface::GetDomainLocalModuleDataFromModule
ISOSDacInterface::GetThreadLocalModuleData
ISOSDacInterface::GetPrivateBinPaths
ISOSDacInterface::GetAppDomainConfigFile
ISOSDacInterface::GetApplicationBase

@Copilot Copilot AI review requested due to automatic review settings April 30, 2025 21:40
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements no-op versions of various ISOSDacInterface methods for CoreCLR by returning fixed error codes and adding debug assertions that compare legacy implementation results.

  • Updated several interface methods to return constant error codes.
  • Added #if DEBUG blocks with Debug.Assert calls to verify that the legacy implementation returns matching error codes in debug builds.

Comment on lines +101 to +105
if (_legacyImpl is not null)
{
int hrLocal = _legacyImpl.GetAppDomainConfigFile(appDomain, count, configFile, pNeeded);
Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
}
Copy link
Preview

Copilot AI Apr 30, 2025

Choose a reason for hiding this comment

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

Multiple no-op implementations repeat a similar debug assertion block for verifying legacy implementation results. Consider refactoring this common pattern into a helper method to reduce duplication and improve maintainability.

Suggested change
if (_legacyImpl is not null)
{
int hrLocal = _legacyImpl.GetAppDomainConfigFile(appDomain, count, configFile, pNeeded);
Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
}
DebugAssertLegacyResult(_legacyImpl, legacy => legacy.GetAppDomainConfigFile(appDomain, count, configFile, pNeeded), hr);

Copilot uses AI. Check for mistakes.

Copy link
Contributor

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@davmason davmason left a comment

Choose a reason for hiding this comment

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

LGTM

@max-charlamb
Copy link
Contributor Author

/azp run runtime-diagnostics

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@max-charlamb
Copy link
Contributor Author

/ba-g Test failures are unrelated to changes in this PR. Bypassing due to known issue with Build Analysis hanging.

@max-charlamb max-charlamb merged commit 27604b5 into dotnet:main May 1, 2025
149 of 154 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants