未验证 提交 b3d4bf1c 编写于 作者: T Tomáš Matoušek 提交者: GitHub

Subscribe to OnModuleInstanceLoad/OnModuleInstanceUnload events only when...

Subscribe to OnModuleInstanceLoad/OnModuleInstanceUnload events only when managed debugging is being used. (#39568)

Avoids loading Roslyn when debugging native code only.
上级 5a09ff99
......@@ -32,6 +32,8 @@ private sealed class DebuggerService : IDkmCustomMessageForwardReceiver, IDkmMod
DkmCustomMessage IDkmCustomMessageForwardReceiver.SendLower(DkmCustomMessage customMessage)
{
// Initialize the listener before OnModuleInstanceLoad/OnModuleInstanceUnload can be triggered.
// These events are only called when managed debugging is being used due to RuntimeId=DkmRuntimeId.Clr filter in vsdconfigxml.
_listener = (VisualStudioDebugStateChangeListener)customMessage.Parameter1;
return null;
}
......@@ -75,9 +77,12 @@ public VisualStudioDebugStateChangeListener(VisualStudioWorkspace workspace, Vis
_encService = workspace.Services.GetRequiredService<IEditAndContinueWorkspaceService>();
}
/// <summary>
/// Called by the debugger when a debugging session starts and managed debugging is being used.
/// </summary>
public void StartDebugging()
{
// hook up a callbacks (the call blocks until the message is processed):
// Hook up a callbacks (the call blocks until the message is processed).
using (DebuggerComponent.ManagedEditAndContinueService())
{
DkmCustomMessage.Create(
......
......@@ -27,8 +27,10 @@
</Filter>
<Interface Name="IDkmCustomMessageForwardReceiver"/>
</InterfaceGroup>
<InterfaceGroup>
<NoFilter/>
<InterfaceGroup CallOnlyWhenLoaded="true">
<Filter>
<RuntimeId RequiredValue="DkmRuntimeId.Clr"/>
</Filter>
<Interface Name="IDkmModuleInstanceLoadNotification"/>
<Interface Name="IDkmModuleInstanceUnloadNotification"/>
</InterfaceGroup>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册