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

[release/dev17.12] EE: Handle notification when metadata has been invalidated (#75423) #75518

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions eng/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Extensibility" Version="$(MicrosoftVisualStudioExtensibilityVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.Sdk" Version="$(MicrosoftVisualStudioExtensibilityVersion)" />
<PackageVersion Include="Microsoft.VisualStudio.Extensibility.JsonGenerators.Sdk" Version="$(MicrosoftVisualStudioExtensibilityVersion)" />
<PackageVersion Include="Microsoft.VSSDK.Debugger.VSDConfigTool" Version="17.0.1051901-preview" />
<PackageVersion Include="Microsoft.VSSDK.Debugger.VSDConfigTool" Version="17.13.1100801-preview" />
Copy link
Member Author

@cston cston Oct 15, 2024

Choose a reason for hiding this comment

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

Package versions for the debugger packages should be updated to 17.12.* rather than 17.13.* once those packages are available. Marking the PR as BLOCKED until then. #Resolved

<PackageVersion Include="Microsoft.VisualStudio.ProjectSystem" Version="17.0.77-pre-g62a6cb5699" />
<PackageVersion Include="Microsoft.VisualStudio.Progression.CodeSchema" Version="15.8.27812-alpha" />
<PackageVersion Include="Microsoft.VisualStudio.Progression.Common" Version="15.8.27812-alpha" />
Expand Down Expand Up @@ -122,8 +122,8 @@
VS Debugger
-->
<PackageVersion Include="Microsoft.VisualStudio.Debugger.Contracts" Version="17.12.0-beta.24403.1" />
<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" />

<!--
VS .NET Runtime
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<InterfaceGroup
CallOnlyWhenLoaded="true">
<NoFilter/>
<Interface Name="IDkmMetaDataPointerInvalidatedNotification"/>
<Interface Name="IDkmModuleModifiedNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
</InterfaceGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Diagnostics;
using System.IO;
using System.Threading;
using Microsoft.CodeAnalysis.Collections;
using Microsoft.CodeAnalysis.PooledObjects;
using Microsoft.VisualStudio.Debugger;
using Microsoft.VisualStudio.Debugger.CallStack;
Expand All @@ -23,6 +22,7 @@ namespace Microsoft.CodeAnalysis.ExpressionEvaluator
public abstract class ExpressionCompiler :
IDkmClrExpressionCompiler,
IDkmClrExpressionCompilerCallback,
IDkmMetaDataPointerInvalidatedNotification,
IDkmModuleModifiedNotification,
IDkmModuleInstanceUnloadNotification,
IDkmLanguageFrameDecoder,
Expand Down Expand Up @@ -247,6 +247,11 @@ internal static bool ShouldTryAgainWithMoreMetadataBlocks(DkmUtilities.GetMetada
return false;
}

void IDkmMetaDataPointerInvalidatedNotification.OnMetaDataPointerInvalidated(DkmClrModuleInstance moduleInstance)
{
RemoveDataItemIfNecessary(moduleInstance);
}

void IDkmModuleModifiedNotification.OnModuleModified(DkmModuleInstance moduleInstance)
{
RemoveDataItemIfNecessary(moduleInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ internal static bool CrashIfFailFastEnabled(Exception exception)
{
switch (dkmException.Code)
{
case DkmExceptionCode.E_METADATA_UPDATE_DEADLOCK: // Metadata was updated while EE had component lock
case DkmExceptionCode.E_PROCESS_DESTROYED:
case DkmExceptionCode.E_XAPI_REMOTE_CLOSED:
case DkmExceptionCode.E_XAPI_REMOTE_DISCONNECTED:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<RuntimeId RequiredValue="DkmRuntimeId.Clr"/>
<RuntimeId RequiredValue="DkmRuntimeId.ClrNativeCompilation"/>
</Filter>
<Interface Name="IDkmMetaDataPointerInvalidatedNotification"/>
<Interface Name="IDkmModuleInstanceLoadNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
<Interface Name="IDkmModuleModifiedNotification"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace Microsoft.CodeAnalysis.ExpressionEvaluator
internal abstract class FunctionResolver :
FunctionResolverBase<DkmProcess, DkmClrModuleInstance, DkmRuntimeFunctionResolutionRequest>,
IDkmRuntimeFunctionResolver,
IDkmMetaDataPointerInvalidatedNotification,
IDkmModuleInstanceLoadNotification,
IDkmModuleInstanceUnloadNotification,
IDkmModuleModifiedNotification,
Expand Down Expand Up @@ -54,6 +55,13 @@ void IDkmModuleModifiedNotification.OnModuleModified(DkmModuleInstance moduleIns
// caller from modifying modules while binding.
}

void IDkmMetaDataPointerInvalidatedNotification.OnMetaDataPointerInvalidated(DkmClrModuleInstance moduleInstance)
{
// Implementing IDkmMetaDataPointerInvalidatedNotification
// (with Synchronized="true" in .vsdconfigxml) prevents
// caller from modifying modules while binding.
}

void IDkmModuleSymbolsLoadedNotification.OnModuleSymbolsLoaded(DkmModuleInstance moduleInstance, DkmModule module, bool isReload, DkmWorkList workList, DkmEventDescriptor eventDescriptor)
{
OnModuleLoad(moduleInstance, workList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<RuntimeId RequiredValue="DkmRuntimeId.Clr"/>
<RuntimeId RequiredValue="DkmRuntimeId.ClrNativeCompilation"/>
</Filter>
<Interface Name="IDkmMetaDataPointerInvalidatedNotification"/>
<Interface Name="IDkmModuleInstanceLoadNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
<Interface Name="IDkmModuleModifiedNotification"/>
Expand Down
Loading