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

@@ -4,14 +4,7 @@
<ProjectGuid>{8559DD7F-A16F-46D0-A05A-9139FAEBA8FD}</ProjectGuid>
<RootNamespace>Mono.Cecil.Mdb</RootNamespace>
<AssemblyName>Mono.Cecil.Mdb</AssemblyName>
<DefineConstants>$(DefineConstants);CECIL</DefineConstants>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFrameworkVersion)' != 'v2.0' ">
<Reference Include="System.Core" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Mono.Cecil.csproj">
<Project>{D68133BD-1E63-496E-9EDE-4FBDBF77B486}</Project>
@@ -24,5 +17,8 @@
<Compile Include="Mono.CompilerServices.SymbolWriter\*.cs" />
</ItemGroup>
<Import Project="..\..\Mono.Cecil.props" />
<Import Project="$(MSBuildCSharpTargets)" />
</Project>
<Import Project="$(MSBuildCSharpTargets)" Condition=" ! $(NetStandard) " />
<PropertyGroup>
<DefineConstants>$(DefineConstants);CECIL</DefineConstants>
</PropertyGroup>
</Project>

View File

@@ -58,7 +58,14 @@ namespace Mono.Cecil.Mdb {
this.documents = new Dictionary<string, Document> ();
}
public bool ProcessDebugHeader (ImageDebugDirectory directory, byte [] header)
#if !READ_ONLY
public ISymbolWriterProvider GetWriterProvider ()
{
return new MdbWriterProvider ();
}
#endif
public bool ProcessDebugHeader (ImageDebugHeader header)
{
return symbol_file.Guid == module.Mvid;
}

View File

@@ -48,6 +48,11 @@ namespace Mono.Cecil.Mdb {
this.source_files = new Dictionary<string, SourceFile> ();
}
public ISymbolReaderProvider GetReaderProvider ()
{
return new MdbReaderProvider ();
}
SourceFile GetSourceFile (Document document)
{
var url = document.Url;
@@ -158,11 +163,9 @@ namespace Mono.Cecil.Mdb {
writer.DefineLocalVariable (variable.Index, variable.Name);
}
public bool GetDebugHeader (out ImageDebugDirectory directory, out byte [] header)
public ImageDebugHeader GetDebugHeader ()
{
directory = new ImageDebugDirectory ();
header = Empty<byte>.Array;
return false;
return new ImageDebugHeader ();
}
public void Dispose ()

View File

@@ -362,6 +362,7 @@ namespace Mono.CompilerServices.SymbolWriter
compile_unit_hash = new Dictionary<int, CompileUnitEntry> ();
}
#if !NET_CORE
public static MonoSymbolFile ReadSymbolFile (Assembly assembly)
{
string filename = assembly.Location;
@@ -372,6 +373,7 @@ namespace Mono.CompilerServices.SymbolWriter
return ReadSymbolFile (name, assembly_guid);
}
#endif
public static MonoSymbolFile ReadSymbolFile (string mdbFilename)
{
@@ -628,7 +630,11 @@ namespace Mono.CompilerServices.SymbolWriter
{
if (disposing) {
if (reader != null) {
#if NET_CORE
reader.Dispose ();
#else
reader.Close ();
#endif
reader = null;
}
}

View File

@@ -110,9 +110,11 @@ namespace Mono.CompilerServices.SymbolWriter
internal OffsetTable ()
{
#if !NET_CORE
int platform = (int) Environment.OSVersion.Platform;
if ((platform != 4) && (platform != 128))
FileFlags |= Flags.WindowsFileNames;
#endif
}
internal OffsetTable (BinaryReader reader, int major_version, int minor_version)

View File

@@ -27,6 +27,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if !NET_CORE
using System;
using System.Reflection;
@@ -347,3 +348,5 @@ namespace Mono.CompilerServices.SymbolWriter
public ArrayList UsingClauses = new ArrayList ();
}
}
#endif

View File

@@ -1,4 +1,4 @@
#if !READ_ONLY
using Mono.Cecil.Mdb;
using NUnit.Framework;
@@ -83,3 +83,4 @@ namespace Mono.Cecil.Tests {
}
}
}
#endif