Skip to content
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

EE: Handle notification when metadata has been invalidated #75423

Merged
merged 14 commits into from
Oct 15, 2024

Conversation

cston
Copy link
Member

@cston cston commented Oct 7, 2024

Implement notification interface in the EE to ensure assembly metadata is discarded before being invalidated.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead labels Oct 7, 2024
@@ -20,1179 +20,8 @@ public enum DkmExceptionCode
E_FAIL = -2147467259,
//
// Summary:
// A debugger is already attached.
E_ATTACH_DEBUGGER_ALREADY_ATTACHED = -2147221503,
Copy link
Member Author

@cston cston Oct 7, 2024

Choose a reason for hiding this comment

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

Only a few of these values were used, and many were missing. Reduced this to just those values that are used, including the newly referenced value.

@@ -23,6 +22,7 @@ namespace Microsoft.CodeAnalysis.ExpressionEvaluator
public abstract class ExpressionCompiler :
IDkmClrExpressionCompiler,
IDkmClrExpressionCompilerCallback,
IDkmMetaDataPointerInvalidatedNotification,
IDkmModuleModifiedNotification,

Choose a reason for hiding this comment

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

IDkmModuleModifiedNotification

You shouldn't need to implement this anymore (unless this is just a temporary thing to keep tests happy until you are running against a new debugger)

Copy link
Member Author

Choose a reason for hiding this comment

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

I think I'd prefer keeping the implementation of IDkmModuleModifiedNotification, for robustness, assuming it doesn't conflict with IDkmMetaDataPointerInvalidatedNotification.

Choose a reason for hiding this comment

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

They will not conflict - just a bit of a perf overhead since now Rosyln will be notified twice anytime, we modify an assembly.

<PackageVersion Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="17.8.1072001-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="17.8.1072001-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="17.13.1100701-preview" />
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="17.13.1100701-preview" />
Copy link
Member Author

@cston cston Oct 8, 2024

Choose a reason for hiding this comment

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

Do we need to reference a newer version of Microsoft.VSSDK.Debugger.VSDConfigTool (at line 67) as well, so that VSDConfigTool.exe recognizes the added interface? #Closed

@cston cston marked this pull request as ready for review October 8, 2024 04:29
@cston cston requested a review from a team as a code owner October 8, 2024 04:29
@cston cston requested a review from a team October 8, 2024 04:36
@cston
Copy link
Member Author

cston commented Oct 9, 2024

@tmat, @dotnet/roslyn-compiler, please review.

@cston
Copy link
Member Author

cston commented Oct 9, 2024

The failures in the integration tests ("Internal error in the C# compiler") are likely due to the EE depending on Microsoft.VisualStudio.Debugger.*.dll from the latest version of Visual Studio which is not available in CI.

@gregg-miskelly
Copy link

The failures in the integration tests ("Internal error in the C# compiler") are likely due to the EE depending on Microsoft.VisualStudio.Debugger.*.dll from the latest version of Visual Studio which is not available in CI.

FYI Debugger changes are in VS Main 35408.49

@cston
Copy link
Member Author

cston commented Oct 9, 2024

Locally, I was able to run the following integration tests successfully with Visual Studio 35408.184, with a DEBUG build of the Roslyn EE:

  • BasicExpressionEvaluator.*
  • BasicEditAndContinue+CommonProjectSystem.*
  • {Basic,CSharp}Immediate.DumpLocalVariableValue

And with BasicEditAndContinue+CommonProjectSystem.EditLambdaExpression, I verified the EE implementation of IDkmMetaDataPointerInvalidatedNotification.OnMetaDataPointerInvalidated() was called and handled.

@cston cston requested a review from a team as a code owner October 9, 2024 21:32
@cston
Copy link
Member Author

cston commented Oct 15, 2024

@dotnet/roslyn-compiler, @tmat, for a second review please.

@cston cston requested a review from a team October 15, 2024 17:49
@cston cston merged commit d67d258 into dotnet:main Oct 15, 2024
28 checks passed
@cston cston deleted the GetMetaDataBytesPtr branch October 15, 2024 20:24
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Oct 15, 2024
cston added a commit to cston/roslyn that referenced this pull request Oct 15, 2024
jaredpar pushed a commit that referenced this pull request Oct 21, 2024
…alidated (#75423) (#75518)

* EE: Handle notification when metadata has been invalidated (#75423)

* Reference 17.12.1101701-preview packages
@akhera99 akhera99 modified the milestones: Next, 17.13 P1 Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Interactive untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants