From fee6ab6a168f12221235e6aa2f1431160f3f5ce5 Mon Sep 17 00:00:00 2001 From: "Xamarin Public Jenkins (auto-signing)" Date: Sat, 26 May 2018 08:37:10 +0000 Subject: [PATCH] Imported Upstream version 5.14.0.106 Former-commit-id: 03fab0f68b93e237c47a03f7d3793d7f5d7c276d --- configure.REMOVED.git-id | 2 +- configure.ac.REMOVED.git-id | 2 +- .../profiles/net_4_x/Mono.Cecil.Mdb.cs | 4 +- .../net_4_x/Mono.Cecil.cs.REMOVED.git-id | 2 +- external/cecil/Mono.Cecil.Cil/Document.cs | 51 +++++++++++++----- external/cecil/Mono.Cecil.Cil/Symbols.cs | 40 +++++++++++++- external/cecil/Mono.Cecil.nuspec | 2 +- external/cecil/Mono.Cecil/AssemblyReader.cs | 22 +++++--- .../cecil/Mono.Cecil/BaseAssemblyResolver.cs | 6 +++ external/cecil/Mono.Cecil/Import.cs | 18 +++++-- external/cecil/Mono.Cecil/MethodDefinition.cs | 2 + external/cecil/Mono.Cecil/ModuleDefinition.cs | 22 ++++++-- external/cecil/Mono.Cecil/TypeParser.cs | 14 +++-- external/cecil/ProjectInfo.cs | 4 +- .../Test/Mono.Cecil.Tests/AssemblyTests.cs | 10 ++-- .../Test/Mono.Cecil.Tests/ModuleTests.cs | 9 ++++ .../Test/Mono.Cecil.Tests/SymbolTests.cs | 30 +++++++++++ .../Resources/assemblies/mdb-mismatch.dll.mdb | Bin 0 -> 238 bytes .../Resources/assemblies/pdb-mismatch.pdb | Bin 0 -> 420 bytes .../symbols/mdb/Mono.Cecil.Mdb/MdbReader.cs | 12 +---- .../pdb/Mono.Cecil.Pdb/NativePdbReader.cs | 4 +- .../pdb/Mono.Cecil.Pdb/NativePdbWriter.cs | 6 +-- mcs/build/common/Consts.cs | 2 +- .../1051400003/Mono.Cecil.dll.REMOVED.git-id | 2 +- .../Mono.Security.dll.REMOVED.git-id | 2 +- .../System.Configuration.dll.REMOVED.git-id | 2 +- .../System.Numerics.dll.REMOVED.git-id | 2 +- .../System.Security.dll.REMOVED.git-id | 2 +- .../1051400003/System.Xml.dll.REMOVED.git-id | 2 +- .../1051400003/mcs.exe.REMOVED.git-id | 2 +- .../1051400003/mscorlib.dll.REMOVED.git-id | 2 +- .../1051400003/Mono.Cecil.dll.REMOVED.git-id | 2 +- .../Mono.Security.dll.REMOVED.git-id | 2 +- .../System.Configuration.dll.REMOVED.git-id | 2 +- .../System.Numerics.dll.REMOVED.git-id | 2 +- .../System.Security.dll.REMOVED.git-id | 2 +- .../1051400003/System.Xml.dll.REMOVED.git-id | 2 +- .../1051400003/mcs.exe.REMOVED.git-id | 2 +- .../1051400003/mscorlib.dll.REMOVED.git-id | 2 +- .../1051400003/Mono.Cecil.dll.REMOVED.git-id | 2 +- .../Mono.Security.dll.REMOVED.git-id | 2 +- .../System.Configuration.dll.REMOVED.git-id | 2 +- .../System.Numerics.dll.REMOVED.git-id | 2 +- .../System.Security.dll.REMOVED.git-id | 2 +- .../1051400003/System.Xml.dll.REMOVED.git-id | 2 +- .../1051400003/mcs.exe.REMOVED.git-id | 2 +- .../1051400003/mscorlib.dll.REMOVED.git-id | 2 +- mono/mini/version.h | 2 +- mono/profiler/log.c.REMOVED.git-id | 2 +- mono/utils/mono-threads.c | 21 ++++++++ mono/utils/mono-threads.h | 15 +++++- po/mcs/de.gmo | Bin 5406 -> 5406 bytes po/mcs/de.po.REMOVED.git-id | 2 +- po/mcs/es.gmo | Bin 16329 -> 16329 bytes po/mcs/es.po.REMOVED.git-id | 2 +- po/mcs/ja.gmo | Bin 20863 -> 20863 bytes po/mcs/ja.po.REMOVED.git-id | 2 +- po/mcs/mcs.pot | 4 +- po/mcs/pt_BR.gmo | Bin 72806 -> 72806 bytes po/mcs/pt_BR.po.REMOVED.git-id | 2 +- 60 files changed, 271 insertions(+), 93 deletions(-) create mode 100644 external/cecil/Test/Resources/assemblies/mdb-mismatch.dll.mdb create mode 100644 external/cecil/Test/Resources/assemblies/pdb-mismatch.pdb diff --git a/configure.REMOVED.git-id b/configure.REMOVED.git-id index 38b370244d..d3dd049988 100644 --- a/configure.REMOVED.git-id +++ b/configure.REMOVED.git-id @@ -1 +1 @@ -a716110cdcded6f6c9a459907b56b1f4d6eeadbe \ No newline at end of file +fe749f40b031bea9c317a0fdd447b7463c1fa428 \ No newline at end of file diff --git a/configure.ac.REMOVED.git-id b/configure.ac.REMOVED.git-id index db850ae0e8..c401b45676 100644 --- a/configure.ac.REMOVED.git-id +++ b/configure.ac.REMOVED.git-id @@ -1 +1 @@ -1b47868002d8f5b8e4c85708dc50e855d259353b \ No newline at end of file +7dc767be05a654f669f5fcb931c96a68bb03fc6c \ No newline at end of file diff --git a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.Mdb.cs b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.Mdb.cs index 6abd957dba..d2db334776 100644 --- a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.Mdb.cs +++ b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.Mdb.cs @@ -5,9 +5,9 @@ [assembly:System.Reflection.AssemblyVersionAttribute("0.10.0.0")] [assembly:System.CLSCompliantAttribute(false)] [assembly:System.Diagnostics.DebuggableAttribute((System.Diagnostics.DebuggableAttribute.DebuggingModes)(2))] -[assembly:System.Reflection.AssemblyCopyrightAttribute("Copyright © 2008 - 2015 Jb Evain")] +[assembly:System.Reflection.AssemblyCopyrightAttribute("Copyright © 2008 - 2018 Jb Evain")] [assembly:System.Reflection.AssemblyFileVersionAttribute("0.10.0.0")] -[assembly:System.Reflection.AssemblyInformationalVersionAttribute("0.10.0.0-beta7")] +[assembly:System.Reflection.AssemblyInformationalVersionAttribute("0.10.0.0")] [assembly:System.Reflection.AssemblyProductAttribute("Mono.Cecil")] [assembly:System.Reflection.AssemblyTitleAttribute("Mono.Cecil.Mdb")] [assembly:System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8)] diff --git a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id index e8350013a6..3359f9aeac 100644 --- a/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id +++ b/external/api-snapshot/profiles/net_4_x/Mono.Cecil.cs.REMOVED.git-id @@ -1 +1 @@ -ab7d67e411350069bbfbb253ebf85aaea01ddab9 \ No newline at end of file +8d89b5ff7f8c0d7a260c7d6ec5d1b9baf4b22fd2 \ No newline at end of file diff --git a/external/cecil/Mono.Cecil.Cil/Document.cs b/external/cecil/Mono.Cecil.Cil/Document.cs index 2c2d21e1c2..03d3ec301d 100644 --- a/external/cecil/Mono.Cecil.Cil/Document.cs +++ b/external/cecil/Mono.Cecil.Cil/Document.cs @@ -49,12 +49,13 @@ namespace Mono.Cecil.Cil { string url; - byte type; - byte hash_algorithm; - byte language; - byte language_vendor; + Guid type; + Guid hash_algorithm; + Guid language; + Guid language_vendor; byte [] hash; + byte [] embedded_source; public string Url { get { return url; } @@ -62,23 +63,43 @@ namespace Mono.Cecil.Cil { } public DocumentType Type { - get { return (DocumentType) type; } - set { type = (byte) value; } + get { return type.ToType (); } + set { type = value.ToGuid (); } + } + + public Guid TypeGuid { + get { return type; } + set { type = value; } } public DocumentHashAlgorithm HashAlgorithm { - get { return (DocumentHashAlgorithm) hash_algorithm; } - set { hash_algorithm = (byte) value; } + get { return hash_algorithm.ToHashAlgorithm (); } + set { hash_algorithm = value.ToGuid (); } + } + + public Guid HashAlgorithmGuid { + get { return hash_algorithm; } + set { hash_algorithm = value; } } public DocumentLanguage Language { - get { return (DocumentLanguage) language; } - set { language = (byte) value; } + get { return language.ToLanguage (); } + set { language = value.ToGuid (); } + } + + public Guid LanguageGuid { + get { return language; } + set { language = value; } } public DocumentLanguageVendor LanguageVendor { - get { return (DocumentLanguageVendor) language_vendor; } - set { language_vendor = (byte) value; } + get { return language_vendor.ToVendor (); } + set { language_vendor = value.ToGuid (); } + } + + public Guid LanguageVendorGuid { + get { return language_vendor; } + set { language_vendor = value; } } public byte [] Hash { @@ -86,10 +107,16 @@ namespace Mono.Cecil.Cil { set { hash = value; } } + public byte[] EmbeddedSource { + get { return embedded_source; } + set { embedded_source = value; } + } + public Document (string url) { this.url = url; this.hash = Empty.Array; + this.embedded_source = Empty.Array; this.token = new MetadataToken (TokenType.Document); } } diff --git a/external/cecil/Mono.Cecil.Cil/Symbols.cs b/external/cecil/Mono.Cecil.Cil/Symbols.cs index c47761dd90..ef40547c46 100644 --- a/external/cecil/Mono.Cecil.Cil/Symbols.cs +++ b/external/cecil/Mono.Cecil.Cil/Symbols.cs @@ -761,6 +761,44 @@ namespace Mono.Cecil.Cil { ISymbolReader GetSymbolReader (ModuleDefinition module, Stream symbolStream); } +#if !NET_CORE + [Serializable] +#endif + public sealed class SymbolsNotFoundException : FileNotFoundException { + + public SymbolsNotFoundException (string message) : base (message) + { + } + +#if !NET_CORE + SymbolsNotFoundException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + +#if !NET_CORE + [Serializable] +#endif + public sealed class SymbolsNotMatchingException : InvalidOperationException { + + public SymbolsNotMatchingException (string message) : base (message) + { + } + +#if !NET_CORE + SymbolsNotMatchingException ( + System.Runtime.Serialization.SerializationInfo info, + System.Runtime.Serialization.StreamingContext context) + : base (info, context) + { + } +#endif + } + public class DefaultSymbolReaderProvider : ISymbolReaderProvider { readonly bool throw_if_no_symbol; @@ -810,7 +848,7 @@ namespace Mono.Cecil.Cil { } if (throw_if_no_symbol) - throw new FileNotFoundException (string.Format ("No symbol found for file: {0}", fileName)); + throw new SymbolsNotFoundException (string.Format ("No symbol found for file: {0}", fileName)); return null; } diff --git a/external/cecil/Mono.Cecil.nuspec b/external/cecil/Mono.Cecil.nuspec index 4fc12bc83d..ab1d991834 100644 --- a/external/cecil/Mono.Cecil.nuspec +++ b/external/cecil/Mono.Cecil.nuspec @@ -2,7 +2,7 @@ Mono.Cecil - 0.10.0.0-beta7 + 0.10.0.0 Mono.Cecil Jb Evain Jb Evain diff --git a/external/cecil/Mono.Cecil/AssemblyReader.cs b/external/cecil/Mono.Cecil/AssemblyReader.cs index 0be4404289..db98f448e0 100644 --- a/external/cecil/Mono.Cecil/AssemblyReader.cs +++ b/external/cecil/Mono.Cecil/AssemblyReader.cs @@ -105,7 +105,7 @@ namespace Mono.Cecil { : symbol_reader_provider.GetSymbolReader (module, module.FileName); if (reader != null) - module.ReadSymbols (reader); + module.ReadSymbols (reader, parameters.ThrowIfSymbolsAreNotMatching); } if (module.Image.HasDebugTables ()) @@ -834,6 +834,12 @@ namespace Mono.Cecil { types [i] = ReadType (i + 1); } + + if (module.IsWindowsMetadata ()) { + for (uint i = 0; i < length; i++) { + WindowsRuntimeProjections.Project (types [i]); + } + } } static bool IsNested (TypeAttributes attributes) @@ -945,9 +951,6 @@ namespace Mono.Cecil { if (IsNested (attributes)) type.DeclaringType = GetNestedTypeDeclaringType (type); - if (module.IsWindowsMetadata ()) - WindowsRuntimeProjections.Project (type); - return type; } @@ -1035,7 +1038,12 @@ namespace Mono.Cecil { if (type != null) return type; - return ReadTypeDefinition (rid); + type = ReadTypeDefinition (rid); + + if (module.IsWindowsMetadata ()) + WindowsRuntimeProjections.Project (type); + + return type; } TypeDefinition ReadTypeDefinition (uint rid) @@ -2812,9 +2820,9 @@ namespace Mono.Cecil { var name = signature.ReadDocumentName (); documents [i - 1] = new Document (name) { - HashAlgorithm = hash_algorithm.ToHashAlgorithm (), + HashAlgorithmGuid = hash_algorithm, Hash = hash, - Language = language.ToLanguage (), + LanguageGuid = language, token = new MetadataToken (TokenType.Document, i), }; } diff --git a/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs b/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs index cf6a3a3451..97eb4cc20e 100644 --- a/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs +++ b/external/cecil/Mono.Cecil/BaseAssemblyResolver.cs @@ -282,6 +282,12 @@ namespace Mono.Cecil { if (File.Exists (file)) return GetAssembly (file, parameters); + if (on_mono && Directory.Exists (path + "-api")) { + file = Path.Combine (path + "-api", "mscorlib.dll"); + if (File.Exists (file)) + return GetAssembly (file, parameters); + } + return null; } diff --git a/external/cecil/Mono.Cecil/Import.cs b/external/cecil/Mono.Cecil/Import.cs index 3d4d5bb126..68b5cab49e 100644 --- a/external/cecil/Mono.Cecil/Import.cs +++ b/external/cecil/Mono.Cecil/Import.cs @@ -177,7 +177,7 @@ namespace Mono.Cecil { string.Empty, type.Name, module, - ImportScope (type.Assembly ()), + ImportScope (type), type.IsValueType ()); reference.etype = ImportElementType (type); @@ -193,6 +193,11 @@ namespace Mono.Cecil { return reference; } + protected virtual IMetadataScope ImportScope (Type type) + { + return ImportScope (type.Assembly ()); + } + static bool ImportOpenGenericType (Type type, ImportGenericKind import_kind) { return type.IsGenericType () && type.IsGenericTypeDefinition () && import_kind == ImportGenericKind.Open; @@ -294,7 +299,7 @@ namespace Mono.Cecil { return etype; } - AssemblyNameReference ImportScope (SR.Assembly assembly) + protected AssemblyNameReference ImportScope (SR.Assembly assembly) { return ImportReference (assembly.GetName ()); } @@ -504,7 +509,7 @@ namespace Mono.Cecil { type.Namespace, type.Name, module, - ImportScope (type.Scope), + ImportScope (type), type.IsValueType); MetadataSystem.TryProcessPrimitiveTypeReference (reference); @@ -518,7 +523,12 @@ namespace Mono.Cecil { return reference; } - IMetadataScope ImportScope (IMetadataScope scope) + protected virtual IMetadataScope ImportScope (TypeReference type) + { + return ImportScope (type.Scope); + } + + protected IMetadataScope ImportScope (IMetadataScope scope) { switch (scope.MetadataScopeType) { case MetadataScopeType.AssemblyNameReference: diff --git a/external/cecil/Mono.Cecil/MethodDefinition.cs b/external/cecil/Mono.Cecil/MethodDefinition.cs index 5dda999ce0..95245abd2b 100644 --- a/external/cecil/Mono.Cecil/MethodDefinition.cs +++ b/external/cecil/Mono.Cecil/MethodDefinition.cs @@ -165,6 +165,8 @@ namespace Mono.Cecil { // we reset Body to null in ILSpy to save memory; so we need that operation to be thread-safe lock (module.SyncRoot) { body = value; + if (value == null) + this.debug_info = null; } } } diff --git a/external/cecil/Mono.Cecil/ModuleDefinition.cs b/external/cecil/Mono.Cecil/ModuleDefinition.cs index 85381c0bbd..b61cc9ef7a 100644 --- a/external/cecil/Mono.Cecil/ModuleDefinition.cs +++ b/external/cecil/Mono.Cecil/ModuleDefinition.cs @@ -38,6 +38,7 @@ namespace Mono.Cecil { Stream symbol_stream; ISymbolReaderProvider symbol_reader_provider; bool read_symbols; + bool throw_symbols_mismatch; bool projections; bool in_memory; bool read_write; @@ -89,6 +90,11 @@ namespace Mono.Cecil { set { read_symbols = value; } } + public bool ThrowIfSymbolsAreNotMatching { + get { return throw_symbols_mismatch; } + set { throw_symbols_mismatch = value; } + } + public bool ReadWrite { get { return read_write; } set { read_write = value; } @@ -107,6 +113,7 @@ namespace Mono.Cecil { public ReaderParameters (ReadingMode readingMode) { this.reading_mode = readingMode; + this.throw_symbols_mismatch = true; } } @@ -691,7 +698,7 @@ namespace Mono.Cecil { public TypeReference GetType (string fullName, bool runtimeName) { return runtimeName - ? TypeParser.ParseType (this, fullName) + ? TypeParser.ParseType (this, fullName, typeDefinitionOnly: true) : GetType (fullName); } @@ -1077,10 +1084,15 @@ namespace Mono.Cecil { throw new InvalidOperationException (); var provider = new DefaultSymbolReaderProvider (throwIfNoSymbol: true); - ReadSymbols (provider.GetSymbolReader (this, file_name)); + ReadSymbols (provider.GetSymbolReader (this, file_name), throwIfSymbolsAreNotMaching: true); } public void ReadSymbols (ISymbolReader reader) + { + ReadSymbols(reader, throwIfSymbolsAreNotMaching: true); + } + + public void ReadSymbols (ISymbolReader reader, bool throwIfSymbolsAreNotMaching) { if (reader == null) throw new ArgumentNullException ("reader"); @@ -1089,7 +1101,11 @@ namespace Mono.Cecil { if (!symbol_reader.ProcessDebugHeader (GetDebugHeader ())) { symbol_reader = null; - throw new InvalidOperationException (); + + if (throwIfSymbolsAreNotMaching) + throw new SymbolsNotMatchingException ("Symbols were found but are not matching the assembly"); + + return; } if (HasImage && ReadingMode == ReadingMode.Immediate) { diff --git a/external/cecil/Mono.Cecil/TypeParser.cs b/external/cecil/Mono.Cecil/TypeParser.cs index 02f3036f37..d7c6aab1b0 100644 --- a/external/cecil/Mono.Cecil/TypeParser.cs +++ b/external/cecil/Mono.Cecil/TypeParser.cs @@ -234,20 +234,24 @@ namespace Mono.Cecil { return fullname.Substring (start, position - start); } - public static TypeReference ParseType (ModuleDefinition module, string fullname) + public static TypeReference ParseType (ModuleDefinition module, string fullname, bool typeDefinitionOnly = false) { if (string.IsNullOrEmpty (fullname)) return null; var parser = new TypeParser (fullname); - return GetTypeReference (module, parser.ParseType (true)); + return GetTypeReference (module, parser.ParseType (true), typeDefinitionOnly); } - static TypeReference GetTypeReference (ModuleDefinition module, Type type_info) + static TypeReference GetTypeReference (ModuleDefinition module, Type type_info, bool type_def_only) { TypeReference type; - if (!TryGetDefinition (module, type_info, out type)) + if (!TryGetDefinition (module, type_info, out type)) { + if (type_def_only) + return null; + type = CreateReference (type_info, module, GetMetadataScope (module, type_info)); + } return CreateSpecs (type, type_info); } @@ -296,7 +300,7 @@ namespace Mono.Cecil { var instance_arguments = instance.GenericArguments; for (int i = 0; i < generic_arguments.Length; i++) - instance_arguments.Add (GetTypeReference (type.Module, generic_arguments [i])); + instance_arguments.Add (GetTypeReference (type.Module, generic_arguments [i], false)); return instance; } diff --git a/external/cecil/ProjectInfo.cs b/external/cecil/ProjectInfo.cs index 0b94141540..a2a550d442 100644 --- a/external/cecil/ProjectInfo.cs +++ b/external/cecil/ProjectInfo.cs @@ -11,10 +11,10 @@ using System.Reflection; using System.Runtime.InteropServices; [assembly: AssemblyProduct (Consts.AssemblyName)] -[assembly: AssemblyCopyright ("Copyright © 2008 - 2015 Jb Evain")] +[assembly: AssemblyCopyright ("Copyright © 2008 - 2018 Jb Evain")] [assembly: ComVisible (false)] [assembly: AssemblyVersion ("0.10.0.0")] [assembly: AssemblyFileVersion ("0.10.0.0")] -[assembly: AssemblyInformationalVersion ("0.10.0.0-beta7")] +[assembly: AssemblyInformationalVersion ("0.10.0.0")] diff --git a/external/cecil/Test/Mono.Cecil.Tests/AssemblyTests.cs b/external/cecil/Test/Mono.Cecil.Tests/AssemblyTests.cs index 0b7c7c1f3b..649dca185b 100644 --- a/external/cecil/Test/Mono.Cecil.Tests/AssemblyTests.cs +++ b/external/cecil/Test/Mono.Cecil.Tests/AssemblyTests.cs @@ -1,6 +1,7 @@ using System; using Mono.Cecil; +using Mono.Cecil.Cil; using NUnit.Framework; @@ -91,15 +92,16 @@ namespace Mono.Cecil.Tests { } [Test] - public void MismatchedLibraryAndSymbols_DoNotThrow () + public void MismatchedLibraryAndSymbols () { // SQLite-net.dll (from nuget) shiped with mismatched symbol files, but throwIfNoSymbol did not prevent it from throwing - var readerParms = new ReaderParameters { + var parameters = new ReaderParameters { ReadSymbols = true, - SymbolReaderProvider = new Cil.DefaultSymbolReaderProvider (throwIfNoSymbol: false) + SymbolReaderProvider = new DefaultSymbolReaderProvider (throwIfNoSymbol: false), + ThrowIfSymbolsAreNotMatching = false, }; - using (var module = GetResourceModule ("SQLite-net.dll", readerParms)) { + using (var module = GetResourceModule ("SQLite-net.dll", parameters)) { Assert.Null (module.SymbolReader); } } diff --git a/external/cecil/Test/Mono.Cecil.Tests/ModuleTests.cs b/external/cecil/Test/Mono.Cecil.Tests/ModuleTests.cs index 2b8eda19cd..2fbe55a098 100644 --- a/external/cecil/Test/Mono.Cecil.Tests/ModuleTests.cs +++ b/external/cecil/Test/Mono.Cecil.Tests/ModuleTests.cs @@ -254,6 +254,15 @@ namespace Mono.Cecil.Tests { } } + [Test] + public void GetNonExistentTypeRuntimeName () + { + using (var module = GetResourceModule ("libhello.dll")) { + var type = module.GetType ("DoesNotExist", runtimeName: true); + Assert.IsNull (type); + } + } + [Test] public void OpenModuleImmediate () { diff --git a/external/cecil/Test/Mono.Cecil.Tests/SymbolTests.cs b/external/cecil/Test/Mono.Cecil.Tests/SymbolTests.cs index e2bb51ca34..d1f239e3fe 100644 --- a/external/cecil/Test/Mono.Cecil.Tests/SymbolTests.cs +++ b/external/cecil/Test/Mono.Cecil.Tests/SymbolTests.cs @@ -50,6 +50,36 @@ namespace Mono.Cecil.Tests { Assert.AreEqual (typeof (PortablePdbReader), module.SymbolReader.GetType ()); }, symbolReaderProvider: typeof (DefaultSymbolReaderProvider), symbolWriterProvider: typeof (DefaultSymbolWriterProvider), verify: !Platform.OnMono); } + + [Test] + public void MdbMismatch () + { + Assert.Throws (() => GetResourceModule ("mdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new MdbReaderProvider () })); + } + + [Test] + public void MdbIgnoreMismatch() + { + using (var module = GetResourceModule ("mdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new MdbReaderProvider (), ThrowIfSymbolsAreNotMatching = false })) { + Assert.IsNull (module.SymbolReader); + Assert.IsFalse (module.HasSymbols); + } + } + + [Test] + public void PortablePdbMismatch () + { + Assert.Throws (() => GetResourceModule ("pdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new PortablePdbReaderProvider () })); + } + + [Test] + public void PortablePdbIgnoreMismatch() + { + using (var module = GetResourceModule ("pdb-mismatch.dll", new ReaderParameters { SymbolReaderProvider = new PortablePdbReaderProvider (), ThrowIfSymbolsAreNotMatching = false })) { + Assert.IsNull (module.SymbolReader); + Assert.IsFalse (module.HasSymbols); + } + } } } #endif \ No newline at end of file diff --git a/external/cecil/Test/Resources/assemblies/mdb-mismatch.dll.mdb b/external/cecil/Test/Resources/assemblies/mdb-mismatch.dll.mdb new file mode 100644 index 0000000000000000000000000000000000000000..11bff77d4345c77a40b24656bbbdc37751cb4020 GIT binary patch literal 238 zcmWexR{vL7?S-om0|cycwX8m7x6^g=@#3{lnQRT;0fh^II1Gpxf%q8^b3obmpll`} zeGG^tfEWfq`as}65P;Nk0x?J(ud`K5Np3+*PG*u`a&f}4JcsisO+MQ`I9+KhT0T?s zo}>EDK#rgK$9!%T?~e5YTM5*~$jG>ekzq085=O8g{K7yHCML#Bj0~F@w*bX}E@N8( YRJRmj3)>zby%nSnh(WFg(er^A0Ep@_{Qv*} literal 0 HcmV?d00001 diff --git a/external/cecil/Test/Resources/assemblies/pdb-mismatch.pdb b/external/cecil/Test/Resources/assemblies/pdb-mismatch.pdb new file mode 100644 index 0000000000000000000000000000000000000000..86b2654a10d11665f6357e9dcd7e5851abc7cd5c GIT binary patch literal 420 zcmZhK!96)R4fcQ>1`5?n&@87UoW$Ev^CU2sy zctHf4v8U8;pfH2G2m=ErkOsMm7l@glY>@l7p=^kY!E#XMBA^TiG=TMi1Yv4GqUt~% zGCzz}@XW*o7QXY}sIH!6DwW01Fr!*2B|o_|H#M)MSjnnd$=NCFFms)qco|sIJGD_Kd%I6f?jfdu6|N} zQ3^0z^f3(3H?%ZQu{1MHO*Kz51Y(P%6yxO7L{rlw(=tools_data) + return FALSE; + info->tools_data = data; + return TRUE; +} + +void* +mono_thread_info_get_tools_data (void) +{ + MonoThreadInfo *info = mono_thread_info_current_unchecked (); + + return info ? info->tools_data : NULL; +} diff --git a/mono/utils/mono-threads.h b/mono/utils/mono-threads.h index d3b3223c44..0869b0604b 100644 --- a/mono/utils/mono-threads.h +++ b/mono/utils/mono-threads.h @@ -260,6 +260,12 @@ typedef struct { gint32 thread_wait_info; #endif + /* + * This is where we store tools tls data so it follows our lifecycle and doesn't depends on posix tls cleanup ordering + * + * TODO support multiple values by multiple tools + */ + void *tools_data; } MonoThreadInfo; typedef struct { @@ -374,7 +380,7 @@ mono_threads_get_runtime_callbacks (void); MONO_API int mono_thread_info_register_small_id (void); -THREAD_INFO_TYPE * +MONO_API THREAD_INFO_TYPE * mono_thread_info_attach (void); MONO_API void @@ -395,6 +401,13 @@ mono_thread_info_is_exiting (void); THREAD_INFO_TYPE * mono_thread_info_current (void); +MONO_API gboolean +mono_thread_info_set_tools_data (void *data); + +MONO_API void* +mono_thread_info_get_tools_data (void); + + THREAD_INFO_TYPE* mono_thread_info_current_unchecked (void); diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo index fb680166ce89b7c881a4b5be4cd6eba30bb4600b..a2b25d8b7efd18e1fe9b0cdf316ff3082fd46ac2 100644 GIT binary patch delta 14 VcmbQIHBW29Q!Ylc&Cj?jxBx6c1xx?{ delta 14 VcmbQIHBW29Q!Yl+&Cj?jxBx6W1xo+` diff --git a/po/mcs/de.po.REMOVED.git-id b/po/mcs/de.po.REMOVED.git-id index d4eec25582..5f85b6871f 100644 --- a/po/mcs/de.po.REMOVED.git-id +++ b/po/mcs/de.po.REMOVED.git-id @@ -1 +1 @@ -7724023d7bbd0c27a29e20cfd192b6f0c87f8e46 \ No newline at end of file +993e91d118061cb6c998fd8fd93e0c1f56512878 \ No newline at end of file diff --git a/po/mcs/es.gmo b/po/mcs/es.gmo index 6305a285bf5b529d234a9d2c4db15a397baa8798..d66ea091566f99eb82f1689affe12e48491dcaac 100644 GIT binary patch delta 14 VcmX?Ef3kjqo+6{!W_`t3asV+Q1%dzo delta 14 VcmX?Ef3kjqo+6{^W_`t3asV+K1%Utn diff --git a/po/mcs/es.po.REMOVED.git-id b/po/mcs/es.po.REMOVED.git-id index 7e344eb473..6abdcb2a93 100644 --- a/po/mcs/es.po.REMOVED.git-id +++ b/po/mcs/es.po.REMOVED.git-id @@ -1 +1 @@ -4541123f4a3b60c078f9453b0aee658b5d9f84d8 \ No newline at end of file +5a0116507c6e2aca6f921a00369b6f9cfab68606 \ No newline at end of file diff --git a/po/mcs/ja.gmo b/po/mcs/ja.gmo index 2f7e185a64a8ac484c47f2ffaeffe11de6bc96e3..a201c075d931de088d5e26a59e8ed9ea6afce544 100644 GIT binary patch delta 16 Xcmeyri1Gg-#tj_mjAolT)yuR1Jo^RS delta 16 Xcmeyri1Gg-#tj_mjHa78)yuR1JoN?L diff --git a/po/mcs/ja.po.REMOVED.git-id b/po/mcs/ja.po.REMOVED.git-id index 74d112520d..d5ff67f228 100644 --- a/po/mcs/ja.po.REMOVED.git-id +++ b/po/mcs/ja.po.REMOVED.git-id @@ -1 +1 @@ -69665d4daa34511c8358f5081b675ed8491a37ed \ No newline at end of file +a336321819d17f5fc46f82bff2ebbe6a0a2f139a \ No newline at end of file diff --git a/po/mcs/mcs.pot b/po/mcs/mcs.pot index f4838e4bb8..fa32923640 100644 --- a/po/mcs/mcs.pot +++ b/po/mcs/mcs.pot @@ -6,9 +6,9 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: mono 5.14.0.103\n" +"Project-Id-Version: mono 5.14.0.106\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" -"POT-Creation-Date: 2018-05-25 08:15+0000\n" +"POT-Creation-Date: 2018-05-26 08:15+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/po/mcs/pt_BR.gmo b/po/mcs/pt_BR.gmo index 5787db25cdb7bd47413b89d60fba1193b0d6b677..5880b2e3d7cb114e67007c501a83be139db50c92 100644 GIT binary patch delta 16 YcmaF1gXP%{mJM-J8O=7wPi1ch07Y5{Q~&?~ delta 16 YcmaF1gXP%{mJM-J8BI6GPi1ch07X;>Qvd(} diff --git a/po/mcs/pt_BR.po.REMOVED.git-id b/po/mcs/pt_BR.po.REMOVED.git-id index 89c7c51690..c3e27aa398 100644 --- a/po/mcs/pt_BR.po.REMOVED.git-id +++ b/po/mcs/pt_BR.po.REMOVED.git-id @@ -1 +1 @@ -8a5f460a338d9e65fe7009b48441ceac63a6fa5d \ No newline at end of file +6d97519d1d89ee8964144aec48af09514b2a223b \ No newline at end of file