Imported Upstream version 5.2.0.175

Former-commit-id: bb0468d0f257ff100aa895eb5fe583fb5dfbf900
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-06-07 13:16:24 +00:00
parent 4bdbaf4a88
commit 966bba02bb
8776 changed files with 346420 additions and 149650 deletions

View File

@@ -0,0 +1,38 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.StackTrace", "src\System.Diagnostics.StackTrace.csproj", "{02304469-722E-4723-92A1-820B9A37D275}"
ProjectSection(ProjectDependencies) = postProject
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6} = {C38217EF-88F4-4D56-9F58-780BE1DDAFF6}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Diagnostics.StackTrace", "ref\System.Diagnostics.StackTrace.csproj", "{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E107E9C1-E893-4E87-987E-04EF0DCEAEFD}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{2E666815-2EDB-464B-9DF6-380BF4789AD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{02304469-722E-4723-92A1-820B9A37D275}.Debug|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Debug|Any CPU
{02304469-722E-4723-92A1-820B9A37D275}.Debug|Any CPU.Build.0 = netcoreapp-Windows_NT-Debug|Any CPU
{02304469-722E-4723-92A1-820B9A37D275}.Release|Any CPU.ActiveCfg = netcoreapp-Windows_NT-Release|Any CPU
{02304469-722E-4723-92A1-820B9A37D275}.Release|Any CPU.Build.0 = netcoreapp-Windows_NT-Release|Any CPU
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}.Debug|Any CPU.ActiveCfg = netcoreapp-Debug|Any CPU
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}.Debug|Any CPU.Build.0 = netcoreapp-Debug|Any CPU
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}.Release|Any CPU.ActiveCfg = netcoreapp-Release|Any CPU
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}.Release|Any CPU.Build.0 = netcoreapp-Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{02304469-722E-4723-92A1-820B9A37D275} = {E107E9C1-E893-4E87-987E-04EF0DCEAEFD}
{C38217EF-88F4-4D56-9F58-780BE1DDAFF6} = {2E666815-2EDB-464B-9DF6-380BF4789AD4}
EndGlobalSection
EndGlobal

View File

@@ -4,5 +4,7 @@
<PropertyGroup>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<IsNETCoreApp>true</IsNETCoreApp>
<IsDesktopFacade>true</IsDesktopFacade>
<IsUAP>true</IsUAP>
</PropertyGroup>
</Project>

View File

@@ -3,6 +3,7 @@
<PropertyGroup>
<BuildConfigurations>
netcoreapp;
netfx;
uap;
</BuildConfigurations>
</PropertyGroup>

View File

@@ -1,14 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<PropertyGroup>
<NoWarn Condition="'$(TargetGroup)' == 'netfx'">$(NoWarn);0436</NoWarn>
<ProjectGuid>{C38217EF-88F4-4D56-9F58-780BE1DDAFF6}</ProjectGuid>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="System.Diagnostics.StackTrace.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
<Reference Include="mscorlib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
<ProjectReference Include="..\..\System.Runtime\ref\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\ref\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Reflection\ref\System.Reflection.csproj" />

View File

@@ -1,30 +0,0 @@
Compat issues with assembly System.Diagnostics.StackTrace:
CannotSealType : Type 'System.Diagnostics.StackFrame' is sealed in the implementation but not sealed in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor(System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor(System.Int32)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor(System.Int32, System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor(System.String, System.Int32)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame..ctor(System.String, System.Int32, System.Int32)' does not exist in the implementation but it does exist in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.GetFileColumnNumber()' is non-virtual in the implementation but is virtual in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.GetFileLineNumber()' is non-virtual in the implementation but is virtual in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.GetFileName()' is non-virtual in the implementation but is virtual in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.GetILOffset()' is non-virtual in the implementation but is virtual in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.GetMethod()' is non-virtual in the implementation but is virtual in the contract.
MembersMustExist : Member 'System.Diagnostics.StackFrame.GetNativeOffset()' does not exist in the implementation but it does exist in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackFrame.ToString()' is non-virtual in the implementation but is virtual in the contract.
CannotSealType : Type 'System.Diagnostics.StackTrace' is sealed in the implementation but not sealed in the contract.
MembersMustExist : Member 'System.Int32 System.Diagnostics.StackTrace.METHODS_TO_SKIP' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Diagnostics.StackFrame)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Exception)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Exception, System.Int32)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Exception, System.Int32, System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Int32)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace..ctor(System.Int32, System.Boolean)' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace.FrameCount.get()' does not exist in the implementation but it does exist in the contract.
MembersMustExist : Member 'System.Diagnostics.StackTrace.GetFrame(System.Int32)' does not exist in the implementation but it does exist in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackTrace.GetFrames()' is non-virtual in the implementation but is virtual in the contract.
CannotMakeMemberNonVirtual : Member 'System.Diagnostics.StackTrace.ToString()' is non-virtual in the implementation but is virtual in the contract.
Total Issues: 28

View File

@@ -2,10 +2,11 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
net463-Windows_NT;
uap101aot-Windows_NT;
uapaot-Windows_NT;
netcoreapp-Windows_NT;
netcoreapp-Unix;
uap-Windows_NT;
netfx;
</BuildConfigurations>
</PropertyGroup>
</Project>

View File

@@ -5,30 +5,22 @@
<AssemblyName>System.Diagnostics.StackTrace</AssemblyName>
<ProjectGuid>{02304469-722E-4723-92A1-820B9A37D275}</ProjectGuid>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IsPartialFacadeAssembly Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)' == 'net463'">true</IsPartialFacadeAssembly>
<IsPartialFacadeAssembly>true</IsPartialFacadeAssembly>
<!-- Disable 1685 (aka multiple type definitions) warning so it doesn't turn into an error -->
<NoWarn>$(NoWarn);1685</NoWarn>
</PropertyGroup>
<!-- Default configurations to help VS understand the options -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net463-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'net463-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap101aot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap101aot-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<TargetingPackReference Include="mscorlib" Condition="'$(TargetGroup)' == 'net463'" />
<TargetingPackReference Include="System.Private.CoreLib" Condition="'$(TargetGroup)' != 'net463'" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='uap101aot'">
<TargetingPackReference Include="System.Private.Reflection" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' or '$(TargetGroup)' == 'uap101aot'">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netfx-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
<Compile Include="System\Diagnostics\SymbolStore\ISymbolBinder.cs" />
<Compile Include="System\Diagnostics\SymbolStore\ISymbolDocument.cs" />
<Compile Include="System\Diagnostics\SymbolStore\ISymbolMethod.cs" />
@@ -43,29 +35,28 @@
<Compile Include="System\Diagnostics\SymbolStore\SymLanguageType.cs" />
<Compile Include="System\Diagnostics\SymbolStore\SymLanguageVendor.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp'">
<ItemGroup Condition="'$(TargetGroup)' == 'netcoreapp' or '$(TargetGroup)' == 'uap'">
<Compile Include="System\Diagnostics\StackTraceSymbols.CoreCLR.cs" />
<ProjectReference Include="..\..\System.Collections\src\System.Collections.csproj" />
<ProjectReference Include="..\..\System.Diagnostics.Debug\src\System.Diagnostics.Debug.csproj" />
<ProjectReference Include="..\..\System.IO\src\System.IO.csproj" />
<ProjectReference Include="..\..\System.IO.FileSystem\src\System.IO.FileSystem.csproj" />
<ProjectReference Include="..\..\System.Runtime\src\System.Runtime.csproj" />
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj">
</ProjectReference>
<ProjectReference Include="..\..\System.Runtime.Extensions\src\System.Runtime.Extensions.csproj" />
<ProjectReference Include="..\..\System.Reflection.Metadata\src\System.Reflection.Metadata.csproj" />
<ProjectReference Include="..\..\System.Collections.Immutable\src\System.Collections.Immutable.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='netcoreapp' or '$(TargetGroup)' == 'net463'">
<Compile Include="System\Diagnostics\StackFrameExtensions.CoreCLR.cs" />
<ItemGroup Condition="'$(TargetGroup)' != 'uapaot'">
<Compile Include="System\Diagnostics\StackFrameExtensions.cs" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)'=='uap101aot'">
<Compile Include="System\Diagnostics\StackTrace.CoreRT.cs" />
<Compile Include="System\Diagnostics\StackFrame.CoreRT.cs" />
<Compile Include="System\Diagnostics\StackFrameExtensions.CoreRT.cs" />
<ItemGroup Condition="'$(TargetGroup)' == 'uapaot'">
<Compile Include="System\Diagnostics\SymbolStore\ISymbolDocumentWriter.cs" />
</ItemGroup>
<ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' != 'netfx'">
<ReferenceFromRuntime Include="System.Private.CoreLib" />
</ItemGroup>
<ItemGroup Condition="'$(TargetGroup)' == 'netfx'">
<Reference Include="mscorlib" />
</ItemGroup>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
</Project>

View File

@@ -1,83 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Reflection;
using Internal.Diagnostics;
using Internal.Runtime.Augments;
namespace System.Diagnostics
{
public sealed class StackFrame
{
private readonly IntPtr _ip;
private readonly bool _includeFileInfo;
private bool _fetchedFileInfo;
private string _fileName;
private int _lineNumber;
private int _columnNumber;
public const int OFFSET_UNKNOWN = -1;
internal StackFrame(IntPtr ip, bool includeFileInfo)
{
_ip = ip;
_includeFileInfo = includeFileInfo;
}
public int GetILOffset()
{
return OFFSET_UNKNOWN;
}
public int GetFileColumnNumber()
{
EnsureSourceFileInfo();
return _columnNumber;
}
public int GetFileLineNumber()
{
EnsureSourceFileInfo();
return _lineNumber;
}
public string GetFileName()
{
EnsureSourceFileInfo();
return _fileName;
}
public MethodBase GetMethod()
{
return null;
}
public override string ToString()
{
return StackTraceHelper.FormatStackFrame(_ip, _includeFileInfo);
}
internal IntPtr GetNativeIP()
{
return _ip;
}
internal IntPtr GetNativeImageBase()
{
return _ip - RuntimeAugments.ConvertIpToRva(_ip);
}
private void EnsureSourceFileInfo()
{
//this isn't thread-safe and that is OK
if (!_fetchedFileInfo && _includeFileInfo)
{
StackTraceHelper.TryGetSourceLineInfo(_ip, out _fileName, out _lineNumber, out _columnNumber);
//Even if we didn't get all the data, this is the best we'll get and we shouldn't try again
_fetchedFileInfo = true;
}
}
}
}

View File

@@ -1,21 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace System.Diagnostics
{
public static partial class StackFrameExtensions
{
public static IntPtr GetNativeIP(this StackFrame stackFrame)
{
return IntPtr.Zero;
}
public static IntPtr GetNativeImageBase(this StackFrame stackFrame)
{
return IntPtr.Zero;
}
}
}

View File

@@ -1,21 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace System.Diagnostics
{
public static partial class StackFrameExtensions
{
public static IntPtr GetNativeIP(this StackFrame stackFrame)
{
return stackFrame.GetNativeIP();
}
public static IntPtr GetNativeImageBase(this StackFrame stackFrame)
{
return stackFrame.GetNativeImageBase();
}
}
}

View File

@@ -27,5 +27,15 @@ namespace System.Diagnostics
{
return stackFrame.GetFileName() != null;
}
public static IntPtr GetNativeIP(this StackFrame stackFrame)
{
return IntPtr.Zero;
}
public static IntPtr GetNativeImageBase(this StackFrame stackFrame)
{
return IntPtr.Zero;
}
}
}

View File

@@ -1,52 +0,0 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using Internal.Diagnostics;
namespace System.Diagnostics
{
public sealed class StackTrace
{
private readonly IntPtr[] _ips;
private readonly bool _needFileInfo;
public StackTrace(Exception e, bool needFileInfo)
{
if (e == null)
{
throw new ArgumentNullException(nameof(e));
}
_ips = ExceptionExtensions.GetStackIPs(e);
_needFileInfo = needFileInfo;
}
public StackFrame[] GetFrames()
{
// There are special IPs mixed in to the list that aren't intended to be exposed as StackFrames
// Deliberately doing this without Linq to keep the dependency set down.
StackFrame[] frames = new StackFrame[_ips.Length];
int countNonSpecialIPs = 0;
for (int i = 0; i < _ips.Length; i++)
{
if (_ips[i] != StackTraceHelper.SpecialIP.EdiSeparator)
{
frames[countNonSpecialIPs++] = new StackFrame(_ips[i], _needFileInfo);
}
}
//for compat with CoreCLR, we always return null instead of 0 length array
if (countNonSpecialIPs == 0)
{
return null;
}
Array.Resize(ref frames, countNonSpecialIPs);
return frames;
}
public override string ToString()
{
return StackTraceHelper.FormatStackTrace(_ips, _needFileInfo);
}
}
}