未验证 提交 0183a75f 编写于 作者: D dotnet-automerge-bot 提交者: GitHub

Merge pull request #33338 from dotnet/merges/dev15.9.x-to-dev16.0-preview3

Merge dev15.9.x to dev16.0
......@@ -81,6 +81,7 @@
<MicrosoftNETCoreRuntimeCoreCLRVersion>2.0.0</MicrosoftNETCoreRuntimeCoreCLRVersion>
<!-- Using a private build of Microsoft.Net.Test.SDK to work around issue https://github.com/Microsoft/vstest/issues/1764 -->
<MicrosoftNETTestSdkVersion>15.9.0-dev2</MicrosoftNETTestSdkVersion>
<MicrosoftNetFX20Version>1.0.3</MicrosoftNetFX20Version>
<MicrosoftServiceHubClientVersion>1.3.23</MicrosoftServiceHubClientVersion>
<MicrosoftTplDataflowVersion>4.5.24</MicrosoftTplDataflowVersion>
<MicrosoftVisualBasicVersion>10.1.0</MicrosoftVisualBasicVersion>
......@@ -93,6 +94,8 @@
<MicrosoftVisualStudioDebuggerEngineVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerEngineVersion>
<MicrosoftVisualStudioDebuggerMetadataVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerMetadataVersion>
<MicrosoftVisualStudioDebuggerUIInterfacesVersion>15.0.27309-vsucorediag</MicrosoftVisualStudioDebuggerUIInterfacesVersion>
<MicrosoftVisualStudioDebuggerEngineimplementationVersion>15.7.2082401</MicrosoftVisualStudioDebuggerEngineimplementationVersion>
<MicrosoftVisualStudioDebuggerMetadataimplementationVersion>15.7.2082401</MicrosoftVisualStudioDebuggerMetadataimplementationVersion>
<MicrosoftVisualStudioDesignerInterfacesVersion>1.1.4322</MicrosoftVisualStudioDesignerInterfacesVersion>
<MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>15.8.27812-alpha</MicrosoftVisualStudioDiagnosticsPerformanceProviderVersion>
<MicrosoftVisualStudioSDKEmbedInteropTypesVersion>15.0.17</MicrosoftVisualStudioSDKEmbedInteropTypesVersion>
......@@ -312,6 +315,7 @@
https://dotnet.myget.org/F/sourcelink/api/v3/index.json;
https://myget.org/F/vs-devcore/api/v3/index.json;
https://myget.org/F/vs-editor/api/v3/index.json;
https://myget.org/F/roslyn_concord/api/v3/index.json;
https://vside.myget.org/F/vssdk/api/v3/index.json;
https://vside.myget.org/F/vs-impl/api/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
......
......@@ -22,7 +22,7 @@
<InternalsVisibleTo Include="Microsoft.VisualStudio.ProductionBreakpoints.CodeAnalysis" Key="$(VisualStudioDebuggerKey)" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
</ItemGroup>
<Import Project="$(RepositoryEngineeringDir)targets\Vsdconfig.targets" />
</Project>
\ No newline at end of file
......@@ -30,8 +30,9 @@
<ProjectReference Include="..\..\..\..\Core\Source\ResultProvider\NetFX20\ResultProvider.NetFX20.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<Import Project="..\CSharpResultProvider.projitems" Label="Shared" />
<Import Project="$(RepositoryEngineeringDir)targets\Vsdconfig.targets" />
......
......@@ -30,8 +30,8 @@
<ProjectReference Include="..\..\..\..\Core\Source\ResultProvider\Portable\Microsoft.CodeAnalysis.ResultProvider.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
</ItemGroup>
<Import Project="..\CSharpResultProvider.projitems" Label="Shared" />
<Import Project="$(RepositoryEngineeringDir)targets\Vsdconfig.targets" />
......
......@@ -30,7 +30,7 @@
<EmbeddedResource Include="Resources\WindowsProxy.winmd" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.DiaSymReader" Version="$(MicrosoftDiaSymReaderVersion)" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -43,9 +43,9 @@
<ItemGroup>
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata">
<Version>$(MicrosoftVisualStudioDebuggerMetadataVersion)</Version>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation">
<Version>$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)</Version>
<ExcludeAssets>compile</ExcludeAssets>
</PackageReference>
</ItemGroup>
......
......@@ -80,8 +80,9 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<ItemGroup>
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider" />
......
......@@ -80,8 +80,8 @@
<InternalsVisibleTo Include="Microsoft.CodeAnalysis.VisualBasic.ExpressionEvaluator.ResultProvider" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
</ItemGroup>
<Import Project="..\ResultProvider.projitems" Label="Shared" />
</Project>
\ No newline at end of file
......@@ -11,7 +11,7 @@
</PropertyGroup>
<ItemGroup Label="File References">
<Reference Include="System" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
</ItemGroup>
<ItemGroup Label="Project References">
<ProjectReference Include="..\..\..\..\Test\Utilities\Portable\Roslyn.Test.Utilities.csproj" />
......
......@@ -25,6 +25,6 @@
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
</ItemGroup>
</Project>
\ No newline at end of file
......@@ -21,7 +21,7 @@
<ItemGroup>
<Reference Include="System" />
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
</ItemGroup>
<ItemGroup Label="Linked Files">
<Compile Include="..\..\..\..\Dependencies\PooledObjects\PooledStringBuilder.cs">
......
......@@ -37,9 +37,9 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata">
<Version>$(MicrosoftVisualStudioDebuggerMetadataVersion)</Version>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation">
<Version>$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)</Version>
<ExcludeAssets>compile</ExcludeAssets>
</PackageReference>
</ItemGroup>
......
......@@ -32,8 +32,9 @@
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
<PackageReference Include="Microsoft.NetFX20" Version="$(MicrosoftNetFX20Version)" />
</ItemGroup>
<ItemGroup>
<Folder Include="My Project\" />
......
......@@ -32,8 +32,8 @@
</Compile>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata" Version="$(MicrosoftVisualStudioDebuggerMetadataVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Metadata-implementation" Version="$(MicrosoftVisualStudioDebuggerMetadataimplementationVersion)" />
</ItemGroup>
<Import Project="..\BasicResultProvider.projitems" Label="Shared" />
<Import Project="$(RepositoryEngineeringDir)targets\Vsdconfig.targets" />
......
......@@ -26,7 +26,7 @@
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.DiaSymReader" Version="$(MicrosoftDiaSymReaderVersion)" />
</ItemGroup>
<ItemGroup>
......
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Collections.Immutable;
......@@ -30,16 +30,15 @@ public Task<ImmutableArray<ActiveStatementDebugInfo>> GetActiveStatementsAsync(C
// TODO: return empty outside of debug session.
// https://github.com/dotnet/roslyn/issues/24325
int unexpectedError = 0;
var completion = new TaskCompletionSource<ImmutableArray<ActiveStatementDebugInfo>>();
var builders = default(ArrayBuilder<ArrayBuilder<ActiveStatementDebugInfo>>);
int pendingRuntimes = 0;
int runtimeCount = 0;
var workList = DkmWorkList.Create(CompletionRoutine: _ =>
{
completion.TrySetException(new InvalidOperationException($"Unexpected error enumerating active statements: 0x{unexpectedError:X8}"));
});
// No exception should be thrown in case of errors on the debugger side.
// The debugger is responsible to provide telemetry for error cases.
// The callback should not be called, but it's there to guarantee that the task completes and a hang is avoided.
var workList = DkmWorkList.Create(_ => { completion.TrySetResult(ImmutableArray<ActiveStatementDebugInfo>.Empty); });
void CancelWork()
{
......@@ -48,11 +47,7 @@ void CancelWork()
FreeBuilders(builders);
builders = null;
// TODO: DkmWorkList.Cancel doesn't currently work when invoked on the completion callback.
// We continue execute all the queued callbacks -- they will be no-ops.
// See https://devdiv.visualstudio.com/DefaultCollection/DevDiv/_workitems/edit/562781.
//
// workList.Cancel();
workList.Cancel(blockOnCompletion: false);
// make sure we cancel with the token we received from the caller:
completion.TrySetCanceled(cancellationToken);
......@@ -72,81 +67,112 @@ void CancelWork()
clrRuntimeInstance.GetActiveStatements(workList, activeStatementsResult =>
{
if (cancellationToken.IsCancellationRequested)
try
{
CancelWork();
return;
}
if (cancellationToken.IsCancellationRequested)
{
CancelWork();
return;
}
if (activeStatementsResult.ErrorCode != 0)
{
unexpectedError = activeStatementsResult.ErrorCode;
return;
}
var localBuilders = builders;
if (localBuilders == null) // e.g. cancelled
{
return;
}
// group active statement by instruction and aggregate flags and threads:
var instructionMap = PooledDictionary<ActiveInstructionId, (DkmInstructionSymbol Symbol, ArrayBuilder<Guid> Threads, int Index, ActiveStatementFlags Flags)>.GetInstance();
if (activeStatementsResult.ErrorCode != 0)
{
localBuilders[runtimeIndex] = ArrayBuilder<ActiveStatementDebugInfo>.GetInstance(0);
GroupActiveStatementsByInstructionId(instructionMap, activeStatementsResult.ActiveStatements);
// the last active statement of the last runtime has been processed:
if (Interlocked.Decrement(ref pendingRuntimes) == 0)
{
completion.TrySetResult(localBuilders.ToFlattenedImmutableArrayAndFree());
}
int pendingStatements = instructionMap.Count;
builders[runtimeIndex] = ArrayBuilder<ActiveStatementDebugInfo>.GetInstance(pendingStatements);
builders[runtimeIndex].Count = pendingStatements;
return;
}
foreach (var (instructionId, (symbol, threads, index, flags)) in instructionMap)
{
var immutableThreads = threads.ToImmutableAndFree();
// group active statement by instruction and aggregate flags and threads:
var instructionMap = PooledDictionary<ActiveInstructionId, (DkmInstructionSymbol Symbol, ArrayBuilder<Guid> Threads, int Index, ActiveStatementFlags Flags)>.GetInstance();
symbol.GetSourcePosition(workList, DkmSourcePositionFlags.None, InspectionSession: null, sourcePositionResult =>
{
if (cancellationToken.IsCancellationRequested)
{
CancelWork();
return;
}
GroupActiveStatementsByInstructionId(instructionMap, activeStatementsResult.ActiveStatements);
int errorCode = sourcePositionResult.ErrorCode;
if (errorCode != 0)
{
unexpectedError = errorCode;
}
int pendingStatements = instructionMap.Count;
localBuilders[runtimeIndex] = ArrayBuilder<ActiveStatementDebugInfo>.GetInstance(pendingStatements);
localBuilders[runtimeIndex].Count = pendingStatements;
DkmSourcePosition position;
string documentNameOpt;
LinePositionSpan span;
if (errorCode == 0 && (position = sourcePositionResult.SourcePosition) != null)
{
documentNameOpt = position.DocumentName;
span = ToLinePositionSpan(position.TextSpan);
}
else
if (instructionMap.Count == 0)
{
if (Interlocked.Decrement(ref pendingRuntimes) == 0)
{
// The debugger can't determine source location for the active statement.
// The PDB might not be available or the statement is in a method that doesn't have debug information.
documentNameOpt = null;
span = default;
completion.TrySetResult(localBuilders.ToFlattenedImmutableArrayAndFree());
}
builders[runtimeIndex][index] = new ActiveStatementDebugInfo(
instructionId,
documentNameOpt,
span,
immutableThreads,
flags);
return;
}
// the last active statement of the current runtime has been processed:
if (Interlocked.Decrement(ref pendingStatements) == 0)
foreach (var (instructionId, (symbol, threads, index, flags)) in instructionMap)
{
var immutableThreads = threads.ToImmutableAndFree();
symbol.GetSourcePosition(workList, DkmSourcePositionFlags.None, InspectionSession: null, sourcePositionResult =>
{
// the last active statement of the last runtime has been processed:
if (Interlocked.Decrement(ref pendingRuntimes) == 0)
try
{
completion.TrySetResult(builders.ToFlattenedImmutableArrayAndFree());
if (cancellationToken.IsCancellationRequested)
{
CancelWork();
return;
}
DkmSourcePosition position;
string documentNameOpt;
LinePositionSpan span;
if (sourcePositionResult.ErrorCode == 0 && (position = sourcePositionResult.SourcePosition) != null)
{
documentNameOpt = position.DocumentName;
span = ToLinePositionSpan(position.TextSpan);
}
else
{
// The debugger can't determine source location for the active statement.
// The PDB might not be available or the statement is in a method that doesn't have debug information.
documentNameOpt = null;
span = default;
}
localBuilders[runtimeIndex][index] = new ActiveStatementDebugInfo(
instructionId,
documentNameOpt,
span,
immutableThreads,
flags);
// the last active statement of the current runtime has been processed:
if (Interlocked.Decrement(ref pendingStatements) == 0)
{
// the last active statement of the last runtime has been processed:
if (Interlocked.Decrement(ref pendingRuntimes) == 0)
{
completion.TrySetResult(localBuilders.ToFlattenedImmutableArrayAndFree());
}
}
}
}
});
}
catch (Exception e)
{
completion.TrySetException(e);
}
});
}
instructionMap.Free();
instructionMap.Free();
}
catch (Exception e)
{
completion.TrySetException(e);
}
});
}
}
......
......@@ -154,7 +154,7 @@
<PackageReference Include="EnvDTE80" Version="$(EnvDTE80Version)" />
<PackageReference Include="Microsoft.CodeAnalysis.Elfie" Version="$(MicrosoftCodeAnalysisElfieVersion)" PrivateAssets="all" />
<PackageReference Include="Microsoft.ServiceHub.Client" Version="$(MicrosoftServiceHubClientVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine" Version="$(MicrosoftVisualStudioDebuggerEngineVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.Engine-implementation" Version="$(MicrosoftVisualStudioDebuggerEngineimplementationVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Debugger.UI.Interfaces" Version="$(MicrosoftVisualStudioDebuggerUIInterfacesVersion)" />
<PackageReference Include="Microsoft.VisualStudio.Telemetry" Version="$(MicrosoftVisualStudioTelemetryVersion)" />
<PackageReference Include="Microsoft.VisualStudio.RemoteControl" Version="$(MicrosoftVisualStudioRemoteControlVersion)" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册