From 2927bc3cc3d723cbc005975b9b5ef1cb589822f0 Mon Sep 17 00:00:00 2001 From: "Xamarin Public Jenkins (auto-signing)" Date: Mon, 9 Jan 2017 11:04:53 +0000 Subject: [PATCH] Imported Upstream version 4.8.0.425 Former-commit-id: 56934f10a9ad11e3eb75c21da859e02f54766140 --- .../ExpressionTest_Call.cs | 2 + .../Test/System.IO.Compression/ZipTest.cs | 16 ++ mcs/class/System.IO.Compression/ZipArchive.cs | 19 +- .../Test/System.Xml.Xsl/XslTransformTests.cs | 27 ++ mcs/class/System/Mono.Btls/MonoBtlsContext.cs | 5 +- .../Mono.Btls/MonoBtlsX509StoreManager.cs | 8 +- .../MonoTlsProviderFactory.cs | 15 +- mcs/class/System/System.Net/ServicePoint.cs | 2 +- .../ClientWebSocketTest.cs | 22 +- .../monolite/System.Xml.dll.REMOVED.git-id | 2 +- .../lib/monolite/System.dll.REMOVED.git-id | 2 +- .../lib/monolite/basic.exe.REMOVED.git-id | 2 +- .../System/Xml/Xsl/Runtime/XsltFunctions.cs | 21 +- mcs/mcs/cs-parser.jay.REMOVED.git-id | 2 +- mcs/tests/test-934.cs | 1 + mcs/tests/ver-il-net_4_x.xml.REMOVED.git-id | 2 +- mcs/tools/mkbundle/mkbundle.cs | 2 +- .../mono-symbolicate/LocationProvider.cs | 204 ++++++++++++++- mcs/tools/mono-symbolicate/StackFrameData.cs | 3 +- mono/metadata/debug-helpers.c | 5 +- mono/metadata/exception-internals.h | 6 + mono/metadata/icall.c.REMOVED.git-id | 2 +- mono/metadata/mono-debug.c | 26 +- mono/metadata/runtime.c | 21 ++ mono/metadata/runtime.h | 2 + mono/mini/Makefile.am | 3 +- mono/mini/Makefile.am.in | 3 +- mono/mini/Makefile.in.REMOVED.git-id | 2 +- mono/mini/debugger-agent.c.REMOVED.git-id | 2 +- mono/mini/method-to-ir.c.REMOVED.git-id | 2 +- mono/mini/mini-arm.c.REMOVED.git-id | 2 +- mono/mini/mini-exceptions-native-unwinder.c | 247 ------------------ mono/mini/mini-exceptions.c | 50 +++- .../mini-generic-sharing.c.REMOVED.git-id | 2 +- mono/mini/mini.h.REMOVED.git-id | 2 +- mono/mini/unwind.c | 86 +++--- mono/mini/version.h | 2 +- msvc/libmono-static.vcxproj | 1 - 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 | 2 +- po/mcs/pt_BR.gmo | Bin 73161 -> 73161 bytes po/mcs/pt_BR.po.REMOVED.git-id | 2 +- 47 files changed, 479 insertions(+), 354 deletions(-) delete mode 100644 mono/mini/mini-exceptions-native-unwinder.c diff --git a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs index 85e011bc27..9513a22c83 100644 --- a/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs +++ b/mcs/class/System.Core/Test/System.Linq.Expressions/ExpressionTest_Call.cs @@ -296,6 +296,7 @@ namespace MonoTests.System.Linq.Expressions { Assert.AreEqual ("foo42", lamda (42, "foo")); } +#if !FULL_AOT_RUNTIME [Test] public void CallDynamicMethod_ToString () { @@ -325,6 +326,7 @@ namespace MonoTests.System.Linq.Expressions { var lambda = Expression.Lambda> (e, i).Compile (); Assert.AreEqual (42, lambda (42)); } +#endif public static int Bang (Expression i) { diff --git a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs index f1b83746b4..343746863e 100644 --- a/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs +++ b/mcs/class/System.IO.Compression/Test/System.IO.Compression/ZipTest.cs @@ -507,6 +507,11 @@ namespace MonoTests.System.IO.Compression /// Simulate "CanSeek" is false, which is the case when you are retreiving data from web. /// public override bool CanSeek => false; + + public override long Position { + get {throw new NotSupportedException();} + set {throw new NotSupportedException();} + } } [Test] @@ -517,5 +522,16 @@ namespace MonoTests.System.IO.Compression { } } + + [Test] + public void ZipWriteNonSeekableStream() { + var stream = new MyFakeStream( "test.nupkg", FileMode.Open ); + using ( var archive = new ZipArchive( stream, ZipArchiveMode.Create ) ) { + var entry = archive.CreateEntry( "foo" ); + using ( var es = entry.Open() ) { + es.Write( new byte[] { 4, 2 }, 0, 2 ); + } + } + } } } diff --git a/mcs/class/System.IO.Compression/ZipArchive.cs b/mcs/class/System.IO.Compression/ZipArchive.cs index 5df9434321..4aa7318e4c 100644 --- a/mcs/class/System.IO.Compression/ZipArchive.cs +++ b/mcs/class/System.IO.Compression/ZipArchive.cs @@ -227,13 +227,20 @@ namespace System.IO.Compression private void Save() { - using (var newZip = new MemoryStream()) { - zipFile.SaveTo(newZip, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8); + if (mode == ZipArchiveMode.Create) + { + zipFile.SaveTo(stream, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8); + } + else { + using (var newZip = new MemoryStream()) + { + zipFile.SaveTo(newZip, CompressionType.Deflate, entryNameEncoding ?? Encoding.UTF8); - stream.SetLength(0); - stream.Position = 0; - newZip.Position = 0; - newZip.CopyTo(stream); + stream.SetLength(0); + stream.Position = 0; + newZip.Position = 0; + newZip.CopyTo(stream); + } } } diff --git a/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs b/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs index f4a49b616f..f6fde5c36c 100644 --- a/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs +++ b/mcs/class/System.XML/Test/System.Xml.Xsl/XslTransformTests.cs @@ -172,6 +172,33 @@ xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl='urn:schemas-micros t.Transform (new XPathDocument (new XmlTextReader (new StringReader (""))), null, sw); } + [Test] + [Category ("MobileNotWorking")] + public void MSXslFormatDate () + { + var arguments = new XsltArgumentList(); + arguments.AddParam("date", "", new DateTime (2010, 11, 22, 5, 4, 3)); + + string xsl = @" + + + + +

The current date is and current time is .

+
+
+
"; + + StringWriter sw = new StringWriter (); + var t = new XslCompiledTransform (); + t.Load (new XPathDocument (new StringReader (xsl))); + + t.Transform (new XPathDocument (new XmlTextReader (new StringReader (""))), arguments, sw); + + Assert.AreEqual ("

The current date is 22 November 2010 and current time is 05:04.

", sw.ToString ()); + } + + [Test] public void EvaluateEmptyVariableAsBoolean () { diff --git a/mcs/class/System/Mono.Btls/MonoBtlsContext.cs b/mcs/class/System/Mono.Btls/MonoBtlsContext.cs index 31c5e22a5e..339ce4e57c 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsContext.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsContext.cs @@ -154,12 +154,9 @@ namespace Mono.Btls } } - Exception GetException (MonoBtlsSslError status) + static Exception GetException (MonoBtlsSslError status) { var error = MonoBtlsError.GetError (); - if (error == null) - return new MonoBtlsException (status); - var text = MonoBtlsError.GetErrorString (error); return new MonoBtlsException ("{0} {1}", status, text); } diff --git a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs index 9b67262aff..0b7fb61f87 100644 --- a/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs +++ b/mcs/class/System/Mono.Btls/MonoBtlsX509StoreManager.cs @@ -45,12 +45,14 @@ namespace Mono.Btls static class MonoBtlsX509StoreManager { static bool initialized; +#if !ANDROID static string machineTrustedRootPath; static string machineIntermediateCAPath; static string machineUntrustedPath; static string userTrustedRootPath; static string userIntermediateCAPath; static string userUntrustedPath; +#endif static void Initialize () { @@ -75,9 +77,9 @@ namespace Mono.Btls userUntrustedPath = Path.Combine (userPath, MX.X509Stores.Names.Untrusted); var machinePath = MX.X509StoreManager.NewLocalMachinePath; - machineTrustedRootPath = Path.Combine (userPath, MX.X509Stores.Names.TrustedRoot); - machineIntermediateCAPath = Path.Combine (userPath, MX.X509Stores.Names.IntermediateCA); - machineUntrustedPath = Path.Combine (userPath, MX.X509Stores.Names.Untrusted); + machineTrustedRootPath = Path.Combine (machinePath, MX.X509Stores.Names.TrustedRoot); + machineIntermediateCAPath = Path.Combine (machinePath, MX.X509Stores.Names.IntermediateCA); + machineUntrustedPath = Path.Combine (machinePath, MX.X509Stores.Names.Untrusted); #endif } diff --git a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs index 071535a5c4..abffd6c2f4 100644 --- a/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs +++ b/mcs/class/System/Mono.Net.Security/MonoTlsProviderFactory.cs @@ -153,16 +153,23 @@ namespace Mono.Net.Security } } + const string LegacyProviderTypeName = "Mono.Net.Security.LegacyTlsProvider"; + const string BtlsProviderTypeName = "Mono.Btls.MonoBtlsProvider"; + static void InitializeProviderRegistration () { lock (locker) { if (providerRegistration != null) return; providerRegistration = new Dictionary (); - providerRegistration.Add ("legacy", "Mono.Net.Security.LegacyTlsProvider"); - providerRegistration.Add ("default", "Mono.Net.Security.LegacyTlsProvider"); - if (IsBtlsSupported ()) - providerRegistration.Add ("btls", "Mono.Btls.MonoBtlsProvider"); + providerRegistration.Add ("legacy", LegacyProviderTypeName); + + bool btls_supported = IsBtlsSupported (); + if (btls_supported) + providerRegistration.Add ("btls", BtlsProviderTypeName); + + providerRegistration.Add ("default", btls_supported && !Platform.IsMacOS ? BtlsProviderTypeName : LegacyProviderTypeName); + X509Helper2.Initialize (); } } diff --git a/mcs/class/System/System.Net/ServicePoint.cs b/mcs/class/System/System.Net/ServicePoint.cs index 953da503f1..9b6cc5cc5e 100644 --- a/mcs/class/System/System.Net/ServicePoint.cs +++ b/mcs/class/System/System.Net/ServicePoint.cs @@ -361,7 +361,7 @@ namespace System.Net return host; } - if (!HasTimedOut) + if (!HasTimedOut && host != null) return host; lastDnsResolve = DateTime.UtcNow; diff --git a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs index e3dd58188c..8bdf264f78 100644 --- a/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs +++ b/mcs/class/System/Test/System.Net.WebSockets/ClientWebSocketTest.cs @@ -17,7 +17,14 @@ namespace MonoTests.System.Net.WebSockets public class ClientWebSocketTest { const string EchoServerUrl = "ws://corefx-net.cloudapp.net/WebSocket/EchoWebSocket.ashx"; - int Port = NetworkHelpers.FindFreePort (); + int port; + int Port { + get { + if (port == 0) + port = NetworkHelpers.FindFreePort (); + return port; + } + } HttpListener _listener; HttpListener listener { get { @@ -158,7 +165,12 @@ namespace MonoTests.System.Net.WebSockets Assert.AreEqual (WebSocketState.Closed, socket.State); } - [Test, ExpectedException (typeof (InvalidOperationException))] + [Test] +#if FEATURE_NO_BSD_SOCKETS + [ExpectedException (typeof (PlatformNotSupportedException))] +#else + [ExpectedException (typeof (InvalidOperationException))] +#endif public void SendAsyncArgTest_NotConnected () { socket.SendAsync (new ArraySegment (new byte[0]), WebSocketMessageType.Text, true, CancellationToken.None); @@ -172,7 +184,11 @@ namespace MonoTests.System.Net.WebSockets socket.SendAsync (new ArraySegment (), WebSocketMessageType.Text, true, CancellationToken.None); } - [Test, ExpectedException (typeof (InvalidOperationException))] +#if FEATURE_NO_BSD_SOCKETS + [ExpectedException (typeof (PlatformNotSupportedException))] +#else + [ExpectedException (typeof (InvalidOperationException))] +#endif public void ReceiveAsyncArgTest_NotConnected () { socket.ReceiveAsync (new ArraySegment (new byte[0]), CancellationToken.None); diff --git a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id index 61403184e0..7ac3365ede 100644 --- a/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.Xml.dll.REMOVED.git-id @@ -1 +1 @@ -0314861ee197046bdbbaf9680511292bbde83c39 \ No newline at end of file +9ae3f67f2d49337f9132b2676053d84cf34ff5d3 \ No newline at end of file diff --git a/mcs/class/lib/monolite/System.dll.REMOVED.git-id b/mcs/class/lib/monolite/System.dll.REMOVED.git-id index 6d0674d220..cf7f5dec1e 100644 --- a/mcs/class/lib/monolite/System.dll.REMOVED.git-id +++ b/mcs/class/lib/monolite/System.dll.REMOVED.git-id @@ -1 +1 @@ -b3586ea6fa1c0ea2a774b82321dc5ea824f48240 \ No newline at end of file +76e2f81fd4a9717c4a69a495cc31a486008065b1 \ No newline at end of file diff --git a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id index d8a3d132e7..46120cf8b4 100644 --- a/mcs/class/lib/monolite/basic.exe.REMOVED.git-id +++ b/mcs/class/lib/monolite/basic.exe.REMOVED.git-id @@ -1 +1 @@ -b3f8f8c80a38ce31cc9e392a4bb960e58d84a21a \ No newline at end of file +e2132b7cb721bf4a4f23e20d5e295687d21b1ddf \ No newline at end of file diff --git a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs index 473cef5a4d..3459ae30e4 100644 --- a/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs +++ b/mcs/class/referencesource/System.Data.SqlXml/System/Xml/Xsl/Runtime/XsltFunctions.cs @@ -291,7 +291,7 @@ namespace System.Xml.Xsl.Runtime { } return d; } - +#if !MONO // CharSet.Auto is needed to work on Windows 98 and Windows Me [DllImport("kernel32.dll", CharSet=CharSet.Auto, BestFitMapping=false)] // SxS: Time formatting does not expose any system resource hence Resource Exposure scope is None. @@ -325,7 +325,7 @@ namespace System.Xml.Xsl.Runtime { this.Milliseconds = (ushort)dateTime.Millisecond; } } - +#endif // string ms:format-date(string datetime[, string format[, string language]]) // string ms:format-time(string datetime[, string format[, string language]]) // @@ -339,12 +339,24 @@ namespace System.Xml.Xsl.Runtime { // passed, the current culture is used. If language is not recognized, a runtime error happens. public static string MSFormatDateTime(string dateTime, string format, string lang, bool isDate) { try { - int locale = GetCultureInfo(lang).LCID; - XsdDateTime xdt; if (! XsdDateTime.TryParse(dateTime, XsdDateTimeFlags.AllXsd | XsdDateTimeFlags.XdrDateTime | XsdDateTimeFlags.XdrTimeNoTz, out xdt)) { return string.Empty; } +#if MONO + string locale = GetCultureInfo(lang).Name; + + DateTime dt = xdt.ToZulu(); + + // If format is the empty string or not specified, use the default format for the given locale + if (format.Length == 0) + { + format = null; + } + return dt.ToString(format, new CultureInfo(locale)); +#else + int locale = GetCultureInfo(lang).LCID; + SystemTime st = new SystemTime(xdt.ToZulu()); StringBuilder sb = new StringBuilder(format.Length + 16); @@ -373,6 +385,7 @@ namespace System.Xml.Xsl.Runtime { } } return sb.ToString(); +#endif } catch (ArgumentException) { // Operations with DateTime can throw this exception eventualy return string.Empty; } diff --git a/mcs/mcs/cs-parser.jay.REMOVED.git-id b/mcs/mcs/cs-parser.jay.REMOVED.git-id index 1670109d4b..6a77458f01 100644 --- a/mcs/mcs/cs-parser.jay.REMOVED.git-id +++ b/mcs/mcs/cs-parser.jay.REMOVED.git-id @@ -1 +1 @@ -bb2bd6e19718cad38c3cf37e8eb131b1b6581685 \ No newline at end of file +a9748379086bbde75a62e2c78329576af82f3755 \ No newline at end of file diff --git a/mcs/tests/test-934.cs b/mcs/tests/test-934.cs index ba464e35e4..62b300d605 100644 --- a/mcs/tests/test-934.cs +++ b/mcs/tests/test-934.cs @@ -10,6 +10,7 @@ class X if (ReferenceEquals (a, b)) return 2; + a = new byte[0]; b = new byte[0]; if (a.Equals (b)) return 3; diff --git a/mcs/tests/ver-il-net_4_x.xml.REMOVED.git-id b/mcs/tests/ver-il-net_4_x.xml.REMOVED.git-id index 1711680d46..69f0fd2658 100644 --- a/mcs/tests/ver-il-net_4_x.xml.REMOVED.git-id +++ b/mcs/tests/ver-il-net_4_x.xml.REMOVED.git-id @@ -1 +1 @@ -f9c8f8b2465c7c00ddc1831c311422c9785ad594 \ No newline at end of file +87b874ce09a0b6bdfc9838d7b448fc99531f03a8 \ No newline at end of file diff --git a/mcs/tools/mkbundle/mkbundle.cs b/mcs/tools/mkbundle/mkbundle.cs index 3351fd24d0..603af9458a 100755 --- a/mcs/tools/mkbundle/mkbundle.cs +++ b/mcs/tools/mkbundle/mkbundle.cs @@ -372,7 +372,7 @@ class MakeBundle { if (fetch_target != null){ var directory = Path.Combine (targets_dir, fetch_target); var zip_download = Path.Combine (directory, "sdk.zip"); - Directory.CreateDirectory (Path.GetDirectoryName (directory)); + Directory.CreateDirectory (directory); var wc = new WebClient (); var uri = new Uri ($"{target_server}{fetch_target}"); try { diff --git a/mcs/tools/mono-symbolicate/LocationProvider.cs b/mcs/tools/mono-symbolicate/LocationProvider.cs index 68387807a5..f03adfdee5 100644 --- a/mcs/tools/mono-symbolicate/LocationProvider.cs +++ b/mcs/tools/mono-symbolicate/LocationProvider.cs @@ -32,7 +32,12 @@ namespace Mono return false; TypeDefinition type = null; - var nested = sfData.TypeFullName.Split ('+'); + string[] nested; + if (sfData.TypeFullName.IndexOf ('/') >= 0) + nested = sfData.TypeFullName.Split ('/'); + else + nested = sfData.TypeFullName.Split ('+'); + var types = assembly.MainModule.Types; foreach (var ntype in nested) { if (type == null) { @@ -53,11 +58,16 @@ namespace Mono var parensStart = sfData.MethodSignature.IndexOf ('('); var methodName = sfData.MethodSignature.Substring (0, parensStart).TrimEnd (); var methodParameters = sfData.MethodSignature.Substring (parensStart); - var method = type.Methods.FirstOrDefault (m => CompareName (m, methodName) && CompareParameters (m.Parameters, methodParameters)); - if (method == null) { + var methods = type.Methods.Where (m => CompareName (m, methodName) && CompareParameters (m.Parameters, methodParameters)).ToArray (); + if (methods.Length == 0) { logger.LogWarning ("Could not find method: {0}", methodName); return false; } + if (methods.Length > 1) { + logger.LogWarning ("Ambiguous match for method: {0}", sfData.MethodSignature); + return false; + } + var method = methods [0]; int ilOffset; if (sfData.IsILOffset) { @@ -100,8 +110,11 @@ namespace Mono if (!candidate.HasGenericParameters) return false; - + var genStart = expected.IndexOf ('['); + if (genStart < 0) + genStart = expected.IndexOf ('<'); + if (genStart < 0) return false; @@ -117,6 +130,36 @@ namespace Mono return candidate.GenericParameters.Count == arity; } + static string RemoveGenerics (string expected, char open, char close) + { + if (expected.IndexOf (open) < 0) + return expected; + + var sb = new StringBuilder (); + for (int i = 0; i < expected.Length;) { + int start = expected.IndexOf (open, i); + int end = expected.IndexOf (close, i); + if (start < 0 || end < 0) { + sb.Append (expected, i, expected.Length - i); + break; + } + + bool is_ginst = false; + for (int j = start + 1; j < end; ++j) { + if (expected [j] != ',') + is_ginst = true; + } + + if (is_ginst) //discard the the generic args + sb.Append (expected, i, start - i); + else //include array arity + sb.Append (expected, i, end + 1 - i); + i = end + 1; + + } + return sb.ToString (); + } + static bool CompareParameters (Collection candidate, string expected) { var builder = new StringBuilder (); @@ -131,11 +174,6 @@ namespace Mono builder.Append ("...,"); var pt = parameter.ParameterType; - if (!string.IsNullOrEmpty (pt.Namespace)) { - builder.Append (pt.Namespace); - builder.Append ("."); - } - FormatElementType (pt, builder); builder.Append (" "); @@ -144,7 +182,150 @@ namespace Mono builder.Append (")"); - return builder.ToString () == expected; + if (builder.ToString () == RemoveGenerics (expected, '[', ']')) + return true; + + //now try the compact runtime format. + + builder.Clear (); + + builder.Append ("("); + + for (int i = 0; i < candidate.Count; i++) { + var parameter = candidate [i]; + if (i > 0) + builder.Append (","); + + if (parameter.ParameterType.IsSentinel) + builder.Append ("...,"); + + var pt = parameter.ParameterType; + + RuntimeFormatElementType (pt, builder); + } + + builder.Append (")"); + + if (builder.ToString () == RemoveGenerics (expected, '<', '>')) + return true; + return false; + + } + + static void RuntimeFormatElementType (TypeReference tr, StringBuilder builder) + { + var ts = tr as TypeSpecification; + if (ts != null) { + if (ts.IsByReference) { + RuntimeFormatElementType (ts.ElementType, builder); + builder.Append ("&"); + return; + } + } + + switch (tr.MetadataType) { + case MetadataType.Void: + builder.Append ("void"); + break; + case MetadataType.Boolean: + builder.Append ("bool"); + break; + case MetadataType.Char: + builder.Append ("char"); + break; + case MetadataType.SByte: + builder.Append ("sbyte"); + break; + case MetadataType.Byte: + builder.Append ("byte"); + break; + case MetadataType.Int16: + builder.Append ("int16"); + break; + case MetadataType.UInt16: + builder.Append ("uint16"); + break; + case MetadataType.Int32: + builder.Append ("int"); + break; + case MetadataType.UInt32: + builder.Append ("uint"); + break; + case MetadataType.Int64: + builder.Append ("long"); + break; + case MetadataType.UInt64: + builder.Append ("ulong"); + break; + case MetadataType.Single: + builder.Append ("single"); + break; + case MetadataType.Double: + builder.Append ("double"); + break; + case MetadataType.String: + builder.Append ("string"); + break; + case MetadataType.Pointer: + builder.Append (((TypeSpecification)tr).ElementType); + builder.Append ("*"); + break; + case MetadataType.ValueType: + case MetadataType.Class: + case MetadataType.GenericInstance: { + FormatName (tr, builder, '/'); + break; + } + case MetadataType.Var: + case MetadataType.MVar: + builder.Append (tr.Name); + builder.Append ("_REF"); + break; + case MetadataType.Array: { + var array = (ArrayType)tr; + RuntimeFormatElementType (array.ElementType, builder); + builder.Append ("["); + + for (int i = 0; i < array.Rank - 1; ++i) + builder.Append (","); + + builder.Append ("]"); + break; + } + + case MetadataType.TypedByReference: + builder.Append ("typedbyref"); + break; + case MetadataType.IntPtr: + builder.Append ("intptr"); + break; + case MetadataType.UIntPtr: + builder.Append ("uintptr"); + break; + case MetadataType.FunctionPointer: + builder.Append ("*()"); + break; + case MetadataType.Object: + builder.Append ("object"); + break; + default: + builder.Append ("-unknown-"); + break; + } + } + + static void FormatName (TypeReference tr, StringBuilder builder, char sep) + { + if (tr.IsNested && !(tr.MetadataType == MetadataType.Var || tr.MetadataType == MetadataType.MVar)) { + FormatName (tr.DeclaringType, builder, sep); + builder.Append (sep); + } + if (!string.IsNullOrEmpty (tr.Namespace)) { + builder.Append (tr.Namespace); + builder.Append ("."); + } + + builder.Append (tr.Name); } static void FormatElementType (TypeReference tr, StringBuilder builder) @@ -170,8 +351,7 @@ namespace Mono return; } } - - builder.Append (tr.Name); + FormatName (tr, builder, '+'); } } } diff --git a/mcs/tools/mono-symbolicate/StackFrameData.cs b/mcs/tools/mono-symbolicate/StackFrameData.cs index 0177fcd610..646cf3a9a4 100644 --- a/mcs/tools/mono-symbolicate/StackFrameData.cs +++ b/mcs/tools/mono-symbolicate/StackFrameData.cs @@ -84,7 +84,8 @@ namespace Mono typeFullName = str.Substring (0, typeNameEnd); // Remove generic parameters - typeFullName = Regex.Replace (typeFullName, @"\[[^\[\]]*\]", ""); + typeFullName = Regex.Replace (typeFullName, @"\[[^\[\]]*\]$", ""); + typeFullName = Regex.Replace (typeFullName, @"\<[^\[\]]*\>$", ""); methodSignature = str.Substring (typeNameEnd + 1); diff --git a/mono/metadata/debug-helpers.c b/mono/metadata/debug-helpers.c index 449895a561..d0937fdf70 100644 --- a/mono/metadata/debug-helpers.c +++ b/mono/metadata/debug-helpers.c @@ -163,7 +163,10 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace) break; case MONO_TYPE_ARRAY: mono_type_get_desc (res, &type->data.array->eklass->byval_arg, include_namespace); - g_string_append_printf (res, "[%d]", type->data.array->rank); + g_string_append_c (res, '['); + for (i = 1; i < type->data.array->rank; ++i) + g_string_append_c (res, ','); + g_string_append_c (res, ']'); break; case MONO_TYPE_SZARRAY: mono_type_get_desc (res, &type->data.klass->byval_arg, include_namespace); diff --git a/mono/metadata/exception-internals.h b/mono/metadata/exception-internals.h index 4a9ad50579..4ba725809c 100644 --- a/mono/metadata/exception-internals.h +++ b/mono/metadata/exception-internals.h @@ -25,4 +25,10 @@ mono_exception_from_token_two_strings_checked (MonoImage *image, uint32_t token, MonoString *a1, MonoString *a2, MonoError *error); + +typedef int (*MonoGetSeqPointFunc) (MonoDomain *domain, MonoMethod *method, gint32 native_offset); + +void +mono_install_get_seq_point (MonoGetSeqPointFunc func); + #endif diff --git a/mono/metadata/icall.c.REMOVED.git-id b/mono/metadata/icall.c.REMOVED.git-id index 27f45a1d26..7b835a820b 100644 --- a/mono/metadata/icall.c.REMOVED.git-id +++ b/mono/metadata/icall.c.REMOVED.git-id @@ -1 +1 @@ -deecd47028339a9eccb62c62fcbb37e6f7ab5357 \ No newline at end of file +4eb9a6416a9d3d3b7e5830b49dd0629e4c81cc9a \ No newline at end of file diff --git a/mono/metadata/mono-debug.c b/mono/metadata/mono-debug.c index b139ce9f3e..4d81eefb8d 100644 --- a/mono/metadata/mono-debug.c +++ b/mono/metadata/mono-debug.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1)) @@ -861,6 +863,14 @@ mono_debug_free_source_location (MonoDebugSourceLocation *location) } } +static int (*get_seq_point) (MonoDomain *domain, MonoMethod *method, gint32 native_offset); + +void +mono_install_get_seq_point (MonoGetSeqPointFunc func) +{ + get_seq_point = func; +} + /** * mono_debug_print_stack_frame: * @native_offset: Native offset within the @method's machine code. @@ -891,10 +901,22 @@ mono_debug_print_stack_frame (MonoMethod *method, guint32 native_offset, MonoDom offset = -1; } + if (offset < 0 && get_seq_point) + offset = get_seq_point (domain, method, native_offset); + if (offset < 0) res = g_strdup_printf ("at %s <0x%05x>", fname, native_offset); - else - res = g_strdup_printf ("at %s ", fname, offset, native_offset); + else { + char *mvid = mono_guid_to_string_minimal ((uint8_t*)method->klass->image->heap_guid.data); + char *aotid = mono_runtime_get_aotid (); + if (aotid) + res = g_strdup_printf ("at %s [0x%05x] in <%s#%s>:0" , fname, offset, mvid, aotid); + else + res = g_strdup_printf ("at %s [0x%05x] in <%s>:0" , fname, offset, mvid); + + g_free (aotid); + g_free (mvid); + } g_free (fname); return res; } diff --git a/mono/metadata/runtime.c b/mono/metadata/runtime.c index 078b4cef99..930af71581 100644 --- a/mono/metadata/runtime.c +++ b/mono/metadata/runtime.c @@ -140,3 +140,24 @@ mono_runtime_init_tls (void) mono_marshal_init_tls (); mono_thread_init_tls (); } + +char* +mono_runtime_get_aotid (void) +{ + int i; + guint8 aotid_sum = 0; + MonoDomain* domain = mono_domain_get (); + + if (!domain->entry_assembly || !domain->entry_assembly->image) + return NULL; + + guint8 (*aotid)[16] = &domain->entry_assembly->image->aotid; + + for (i = 0; i < 16; ++i) + aotid_sum |= (*aotid)[i]; + + if (aotid_sum == 0) + return NULL; + + return mono_guid_to_string ((guint8*) aotid); +} \ No newline at end of file diff --git a/mono/metadata/runtime.h b/mono/metadata/runtime.h index ef14453ceb..65cb5daa4a 100644 --- a/mono/metadata/runtime.h +++ b/mono/metadata/runtime.h @@ -21,6 +21,8 @@ gboolean mono_runtime_is_critical_method (MonoMethod *method); gboolean mono_runtime_try_shutdown (void); void mono_runtime_init_tls (void); + +char* mono_runtime_get_aotid (void); MONO_END_DECLS #endif /* _MONO_METADATA_RUNTIME_H_ */ diff --git a/mono/mini/Makefile.am b/mono/mini/Makefile.am index 6de9f385f6..79a7bb45d9 100644 --- a/mono/mini/Makefile.am +++ b/mono/mini/Makefile.am @@ -439,7 +439,6 @@ common_sources = \ graph.c \ mini-codegen.c \ mini-exceptions.c \ - mini-exceptions-native-unwinder.c \ mini-trampolines.c \ branch-opts.c \ mini-generic-sharing.c \ @@ -860,7 +859,7 @@ EXTRA_DIST = TestDriver.cs \ Makefile.am.in version.h: Makefile - echo "#define FULL_VERSION \"Stable 4.8.0.395/df81fe4\"" > version.h + echo "#define FULL_VERSION \"Stable 4.8.0.425/038ff4a\"" > version.h # Utility target for patching libtool to speed up linking patch-libtool: diff --git a/mono/mini/Makefile.am.in b/mono/mini/Makefile.am.in index 6de9f385f6..79a7bb45d9 100755 --- a/mono/mini/Makefile.am.in +++ b/mono/mini/Makefile.am.in @@ -439,7 +439,6 @@ common_sources = \ graph.c \ mini-codegen.c \ mini-exceptions.c \ - mini-exceptions-native-unwinder.c \ mini-trampolines.c \ branch-opts.c \ mini-generic-sharing.c \ @@ -860,7 +859,7 @@ EXTRA_DIST = TestDriver.cs \ Makefile.am.in version.h: Makefile - echo "#define FULL_VERSION \"Stable 4.8.0.395/df81fe4\"" > version.h + echo "#define FULL_VERSION \"Stable 4.8.0.425/038ff4a\"" > version.h # Utility target for patching libtool to speed up linking patch-libtool: diff --git a/mono/mini/Makefile.in.REMOVED.git-id b/mono/mini/Makefile.in.REMOVED.git-id index 4b1d33f864..ca1c9adada 100644 --- a/mono/mini/Makefile.in.REMOVED.git-id +++ b/mono/mini/Makefile.in.REMOVED.git-id @@ -1 +1 @@ -2128ee71f4bedcfbe65320e1befa9d3044dd5a0b \ No newline at end of file +63cf5db27f8b0ab65c05c36143e0abcf52bcdcf6 \ No newline at end of file diff --git a/mono/mini/debugger-agent.c.REMOVED.git-id b/mono/mini/debugger-agent.c.REMOVED.git-id index f7aa450cbd..18107d3070 100644 --- a/mono/mini/debugger-agent.c.REMOVED.git-id +++ b/mono/mini/debugger-agent.c.REMOVED.git-id @@ -1 +1 @@ -ab39180f7b19cdd884bb41bddd68fd3a34b1c44d \ No newline at end of file +4758c4dcfbe3bc5d33d3541f4cd96367f80f5f92 \ No newline at end of file diff --git a/mono/mini/method-to-ir.c.REMOVED.git-id b/mono/mini/method-to-ir.c.REMOVED.git-id index aed73fd2f9..b7c968e16e 100644 --- a/mono/mini/method-to-ir.c.REMOVED.git-id +++ b/mono/mini/method-to-ir.c.REMOVED.git-id @@ -1 +1 @@ -b2470bd1725bddc8d4b773a0150fdace813b5560 \ No newline at end of file +989d1ceee9a69e6fa24b8a468e3ee04693b4a338 \ No newline at end of file diff --git a/mono/mini/mini-arm.c.REMOVED.git-id b/mono/mini/mini-arm.c.REMOVED.git-id index 91e2188cc5..70746d1f9e 100644 --- a/mono/mini/mini-arm.c.REMOVED.git-id +++ b/mono/mini/mini-arm.c.REMOVED.git-id @@ -1 +1 @@ -135519aac6d9aac84c8ac83259d5bb8ea8cc9c61 \ No newline at end of file +8b0b61e62ad3a349c2c1721e0d36365f3697eccf \ No newline at end of file diff --git a/mono/mini/mini-exceptions-native-unwinder.c b/mono/mini/mini-exceptions-native-unwinder.c deleted file mode 100644 index 08fa26bb1a..0000000000 --- a/mono/mini/mini-exceptions-native-unwinder.c +++ /dev/null @@ -1,247 +0,0 @@ -/* - * mini-exceptions-native-unwinder.c: libcorkscrew-based native unwinder - * - * Authors: - * Alex Rønne Petersen (alexrp@xamarin.com) - * - * Copyright 2015 Xamarin, Inc (http://www.xamarin.com) - * Licensed under the MIT license. See LICENSE file in the project root for full license information. - */ -#include - -#include - -/* - * Attempt to handle native SIGSEGVs with libunwind or libcorkscrew. - */ - -#ifdef HAVE_SIGNAL_H -#include -#endif - -#include -#include "mini.h" - -#if defined (PLATFORM_ANDROID) - -#include -#include -#include - -#define UNW_LOCAL_ONLY -#undef _U /* ctype.h apparently defines this and it screws up the libunwind headers. */ -#include "../../external/android-libunwind/include/libunwind.h" -#define _U 0x01 - -#define FUNC_NAME_LENGTH 512 -#define FRAMES_TO_UNWIND 256 - -/* Expand the SYM argument. */ -#define LOAD_SYM(DL, ERR, SYM, VAR) _LOAD_SYM(DL, ERR, SYM, VAR) -#define _LOAD_SYM(DL, ERR, SYM, VAR) \ - do { \ - if ((ERR = mono_dl_symbol (DL, #SYM, (void **) &VAR))) { \ - mono_dl_close (DL); \ - return ERR; \ - } \ - } while (0) - -typedef int (*unw_init_local_t) (unw_cursor_t *, unw_context_t *); -typedef int (*unw_get_reg_t) (unw_cursor_t *, int, unw_word_t *); -typedef int (*unw_get_proc_name_t) (unw_cursor_t *, char *, size_t, unw_word_t *); -typedef int (*unw_step_t) (unw_cursor_t *); - -static char * -mono_extension_handle_native_sigsegv_libunwind (void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info) -{ - char *dl_err; - int unw_err; - - unw_init_local_t unw_init_local_fn; - unw_get_reg_t unw_get_reg_fn; - unw_get_proc_name_t unw_get_proc_name_fn; - unw_step_t unw_step_fn; - - unw_cursor_t cursor; - - size_t frames = 0; - - MonoDl *dl = mono_dl_open ("libunwind.so", MONO_DL_LAZY, &dl_err); - - if (!dl) - return dl_err; - - LOAD_SYM (dl, dl_err, UNW_OBJ (init_local), unw_init_local_fn); - LOAD_SYM (dl, dl_err, UNW_OBJ (get_reg), unw_get_reg_fn); - LOAD_SYM (dl, dl_err, UNW_OBJ (get_proc_name), unw_get_proc_name_fn); - LOAD_SYM (dl, dl_err, UNW_OBJ (step), unw_step_fn); - - if ((unw_err = unw_init_local_fn (&cursor, ctx))) { - mono_dl_close (dl); - - return g_strdup_printf ("unw_init_local () returned %d", unw_err); - } - - do { - int reg_err; - - unw_word_t ip, off; - char name [FUNC_NAME_LENGTH]; - - if ((reg_err = unw_get_reg_fn (&cursor, UNW_REG_IP, &ip))) { - mono_runtime_printf_err ("unw_get_reg (UNW_REG_IP) returned %d", reg_err); - break; - } - - reg_err = unw_get_proc_name_fn (&cursor, name, FUNC_NAME_LENGTH, &off); - - if (reg_err == -UNW_ENOINFO) - strcpy (name, "???"); - - mono_runtime_printf_err (" at %s+%zu [0x%zx]", name, off, ip); - - unw_err = unw_step_fn (&cursor); - frames++; - } while (unw_err > 0 && frames < FRAMES_TO_UNWIND); - - if (unw_err < 0) - mono_runtime_printf_err ("unw_step () returned %d", unw_err); - - mono_dl_close (dl); - - return NULL; -} - -/* - * This code is based on the AOSP header system/core/include/corkscrew/backtrace.h. - * - * This is copied here because libcorkscrew is not a stable library and the header (and - * other headers that it depends on) will eventually go away. - * - * We can probably remove this one day when libunwind becomes the norm. - */ - -typedef struct { - uintptr_t absolute_pc; - uintptr_t stack_top; - size_t stack_size; -} backtrace_frame_t; - -typedef struct { - uintptr_t relative_pc; - uintptr_t relative_symbol_addr; - char *map_name; - char *symbol_name; - char *demangled_name; -} backtrace_symbol_t; - -typedef void (*get_backtrace_symbols_t) (const backtrace_frame_t *backtrace, size_t frames, backtrace_symbol_t *backtrace_symbols); -typedef void (*free_backtrace_symbols_t) (backtrace_symbol_t *backtrace_symbols, size_t frames); - -enum { - MAX_BACKTRACE_LINE_LENGTH = 800, -}; - -/* Internals that we're exploiting to work in a signal handler. Only works on ARM/x86. */ - -typedef struct map_info_t map_info_t; - -typedef ssize_t (*unwind_backtrace_signal_arch_t) (siginfo_t *si, void *sc, const map_info_t *lst, backtrace_frame_t *bt, size_t ignore_depth, size_t max_depth); -typedef map_info_t *(*acquire_my_map_info_list_t) (void); -typedef void (*release_my_map_info_list_t) (map_info_t *milist); - -static char * -mono_extension_handle_native_sigsegv_libcorkscrew (void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info) -{ -#if defined (__arm__) || defined (__i386__) - char *dl_err; - - get_backtrace_symbols_t get_backtrace_symbols; - free_backtrace_symbols_t free_backtrace_symbols; - unwind_backtrace_signal_arch_t unwind_backtrace_signal_arch; - acquire_my_map_info_list_t acquire_my_map_info_list; - release_my_map_info_list_t release_my_map_info_list; - - backtrace_frame_t frames [FRAMES_TO_UNWIND]; - backtrace_symbol_t symbols [FRAMES_TO_UNWIND]; - - map_info_t *map_info; - ssize_t frames_unwound; - size_t i; - - MonoDl *dl = mono_dl_open ("libcorkscrew.so", MONO_DL_LAZY, &dl_err); - - if (!dl) - return dl_err; - - LOAD_SYM (dl, dl_err, get_backtrace_symbols, get_backtrace_symbols); - LOAD_SYM (dl, dl_err, free_backtrace_symbols, free_backtrace_symbols); - LOAD_SYM (dl, dl_err, unwind_backtrace_signal_arch, unwind_backtrace_signal_arch); - LOAD_SYM (dl, dl_err, acquire_my_map_info_list, acquire_my_map_info_list); - LOAD_SYM (dl, dl_err, release_my_map_info_list, release_my_map_info_list); - - map_info = acquire_my_map_info_list (); - frames_unwound = unwind_backtrace_signal_arch (info, ctx, map_info, frames, 0, FRAMES_TO_UNWIND); - release_my_map_info_list (map_info); - - if (frames_unwound == -1) { - mono_dl_close (dl); - - return g_strdup ("unwind_backtrace_signal_arch () returned -1"); - } - - get_backtrace_symbols (frames, frames_unwound, symbols); - - for (i = 0; i < frames_unwound; i++) { - backtrace_frame_t *frame = frames + i; - backtrace_symbol_t *symbol = symbols + i; - - const char *name = symbol->demangled_name ? symbol->demangled_name : (symbol->symbol_name ? symbol->symbol_name : "???"); - uintptr_t off = symbol->relative_pc - symbol->relative_symbol_addr; - uintptr_t ip = frame->absolute_pc; - - mono_runtime_printf_err (" at %s+%zu [0x%zx]", name, off, ip); - } - - free_backtrace_symbols (symbols, frames_unwound); - - mono_dl_close (dl); - - return NULL; -#else - return g_strdup ("libcorkscrew is only supported on 32-bit ARM/x86"); -#endif -} - -void -mono_exception_native_unwind (void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info) -{ - char *unwind_err, *corkscrew_err; - - mono_runtime_printf_err ("\nAttempting native Android stacktrace:\n"); - - unwind_err = mono_extension_handle_native_sigsegv_libunwind (ctx, info); - - if (unwind_err) { - corkscrew_err = mono_extension_handle_native_sigsegv_libcorkscrew (ctx, info); - - if (corkscrew_err) { - mono_runtime_printf_err ("\tCould not unwind with `libunwind.so`: %s", unwind_err); - mono_runtime_printf_err ("\tCould not unwind with `libcorkscrew.so`: %s", corkscrew_err); - mono_runtime_printf_err ("\n\tNo options left to get a native stacktrace :-("); - - g_free (corkscrew_err); - } - - g_free (unwind_err); - } -} - -#else - -void -mono_exception_native_unwind (void *ctx, MONO_SIG_HANDLER_INFO_TYPE *info) -{ -} - -#endif diff --git a/mono/mini/mini-exceptions.c b/mono/mini/mini-exceptions.c index 8b666bfe70..ec1466dbbf 100644 --- a/mono/mini/mini-exceptions.c +++ b/mono/mini/mini-exceptions.c @@ -96,6 +96,15 @@ static void mono_raise_exception_with_ctx (MonoException *exc, MonoContext *ctx) static void mono_runtime_walk_stack_with_ctx (MonoJitStackWalk func, MonoContext *start_ctx, MonoUnwindOptions unwind_options, void *user_data); static gboolean mono_current_thread_has_handle_block_guard (void); +static int +mono_get_seq_point_for_native_offset (MonoDomain *domain, MonoMethod *method, gint32 native_offset) +{ + SeqPoint sp; + if (mono_find_prev_seq_point_for_native_offset (domain, method, native_offset, NULL, &sp)) + return sp.il_offset; + return -1; +} + void mono_exceptions_init (void) { @@ -139,6 +148,7 @@ mono_exceptions_init (void) cbs.mono_install_handler_block_guard = mono_install_handler_block_guard; cbs.mono_current_thread_has_handle_block_guard = mono_current_thread_has_handle_block_guard; mono_install_eh_callbacks (&cbs); + mono_install_get_seq_point (mono_get_seq_point_for_native_offset); } gpointer @@ -2336,6 +2346,34 @@ print_stack_frame_to_string (StackFrameInfo *frame, MonoContext *ctx, gpointer d #ifndef MONO_CROSS_COMPILE +static void print_process_map () +{ +#ifdef __linux__ + FILE *fp = fopen ("/proc/self/maps", "r"); + char line [256]; + + if (fp == NULL) { + mono_runtime_printf_err ("no /proc/self/maps, not on linux?\n"); + return; + } + + mono_runtime_printf_err ("/proc/self/maps:"); + + while (fgets (line, sizeof (line), fp)) { + // strip newline + size_t len = strlen (line) - 1; + if (len >= 0 && line [len] == '\n') + line [len] = '\0'; + + mono_runtime_printf_err ("%s", line); + } + + fclose (fp); +#else + /* do nothing */ +#endif +} + static gboolean handling_sigsegv = FALSE; /* @@ -2379,6 +2417,8 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i mono_walk_stack (print_stack_frame_to_stderr, MONO_UNWIND_LOOKUP_IL_OFFSET, NULL); } + print_process_map (); + #ifdef HAVE_BACKTRACE_SYMBOLS { void *array [256]; @@ -2431,7 +2471,15 @@ mono_handle_native_sigsegv (int signal, void *ctx, MONO_SIG_HANDLER_INFO_TYPE *i #endif } #else - mono_exception_native_unwind (ctx, info); +#ifdef PLATFORM_ANDROID + /* set DUMPABLE for this process so debuggerd can attach with ptrace(2), see: + * https://android.googlesource.com/platform/bionic/+/151da681000c07da3c24cd30a3279b1ca017f452/linker/debugger.cpp#206 + * this has changed on later versions of Android. Also, we don't want to + * set this on start-up as DUMPABLE has security implications. */ + prctl (PR_SET_DUMPABLE, 1); + + mono_runtime_printf_err ("\nNo native Android stacktrace (see debuggerd output).\n"); +#endif #endif /* diff --git a/mono/mini/mini-generic-sharing.c.REMOVED.git-id b/mono/mini/mini-generic-sharing.c.REMOVED.git-id index 572d53387f..292220e98d 100644 --- a/mono/mini/mini-generic-sharing.c.REMOVED.git-id +++ b/mono/mini/mini-generic-sharing.c.REMOVED.git-id @@ -1 +1 @@ -aca368c9dba9e1ad8ef382fa8e7532a93981ffe5 \ No newline at end of file +7897b982a8180aac7e6fdccf0703ebcdb62cc1b7 \ No newline at end of file diff --git a/mono/mini/mini.h.REMOVED.git-id b/mono/mini/mini.h.REMOVED.git-id index 98db42d75b..0d4fd00acf 100644 --- a/mono/mini/mini.h.REMOVED.git-id +++ b/mono/mini/mini.h.REMOVED.git-id @@ -1 +1 @@ -fa3a3b738e36916c6cd30fdf6def572c1a1506cd \ No newline at end of file +d5708a12125a5eb71fbc4b6a8acf8209bf6561ca \ No newline at end of file diff --git a/mono/mini/unwind.c b/mono/mini/unwind.c index a282429240..6282ee9621 100644 --- a/mono/mini/unwind.c +++ b/mono/mini/unwind.c @@ -46,19 +46,19 @@ static int unwind_info_size; #ifdef TARGET_AMD64 static int map_hw_reg_to_dwarf_reg [] = { 0, 2, 1, 3, 7, 6, 4, 5, 8, 9, 10, 11, 12, 13, 14, 15, 16 }; -#define NUM_REGS AMD64_NREG +#define NUM_DWARF_REGS AMD64_NREG #define DWARF_DATA_ALIGN (-8) #define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (AMD64_RIP)) #elif defined(TARGET_ARM) // http://infocenter.arm.com/help/topic/com.arm.doc.ihi0040a/IHI0040A_aadwarf.pdf /* Assign d8..d15 to hregs 16..24 (dwarf regs 264..271) */ static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 264, 265, 266, 267, 268, 269, 270, 271 }; -#define NUM_REGS 272 +#define NUM_DWARF_REGS 272 #define DWARF_DATA_ALIGN (-4) #define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (ARMREG_LR)) #define IS_DOUBLE_REG(dwarf_reg) (((dwarf_reg) >= 264) && ((dwarf_reg) <= 271)) #elif defined(TARGET_ARM64) -#define NUM_REGS 96 +#define NUM_DWARF_REGS 96 #define DWARF_DATA_ALIGN (-8) /* LR */ #define DWARF_PC_REG 30 @@ -75,7 +75,7 @@ static int map_hw_reg_to_dwarf_reg [] = { */ static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 5, 4, 6, 7, 8 }; /* + 1 is for IP */ -#define NUM_REGS X86_NREG + 1 +#define NUM_DWARF_REGS (X86_NREG + 1) #define DWARF_DATA_ALIGN (-4) #define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (X86_NREG)) #elif defined (TARGET_POWERPC) @@ -84,12 +84,12 @@ static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; -#define NUM_REGS 110 +#define NUM_DWARF_REGS 110 #define DWARF_DATA_ALIGN (-(gint32)sizeof (mgreg_t)) #define DWARF_PC_REG 108 #elif defined (TARGET_S390X) static int map_hw_reg_to_dwarf_reg [] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; -#define NUM_REGS 16 +#define NUM_DWARF_REGS 16 #define DWARF_DATA_ALIGN (-8) #define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (14)) #elif defined (TARGET_MIPS) @@ -100,23 +100,25 @@ static int map_hw_reg_to_dwarf_reg [32] = { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }; -#define NUM_REGS 32 +#define NUM_DWARF_REGS 32 #define DWARF_DATA_ALIGN (-(gint32)sizeof (mgreg_t)) #define DWARF_PC_REG (mono_hw_reg_to_dwarf_reg (mips_ra)) #else static int map_hw_reg_to_dwarf_reg [16]; -#define NUM_REGS 16 +#define NUM_DWARF_REGS 16 #define DWARF_DATA_ALIGN 0 #define DWARF_PC_REG -1 #endif +#define NUM_HW_REGS (sizeof (map_hw_reg_to_dwarf_reg) / sizeof (int)) + #ifndef IS_DOUBLE_REG #define IS_DOUBLE_REG(dwarf_reg) 0 #endif static gboolean dwarf_reg_to_hw_reg_inited; -static int map_dwarf_reg_to_hw_reg [NUM_REGS]; +static int map_dwarf_reg_to_hw_reg [NUM_DWARF_REGS]; /* * mono_hw_reg_to_dwarf_reg: @@ -130,10 +132,10 @@ mono_hw_reg_to_dwarf_reg (int reg) if (reg == ppc_lr) return 108; else - g_assert (reg < NUM_REGS); + g_assert (reg < NUM_HW_REGS); #endif - if (NUM_REGS == 0) { + if (NUM_HW_REGS == 0) { g_assert_not_reached (); return -1; } else { @@ -146,8 +148,8 @@ init_reg_map (void) { int i; - g_assert (NUM_REGS > 0); - for (i = 0; i < sizeof (map_hw_reg_to_dwarf_reg) / sizeof (int); ++i) { + g_assert (NUM_HW_REGS > 0); + for (i = 0; i < NUM_HW_REGS; ++i) { map_dwarf_reg_to_hw_reg [mono_hw_reg_to_dwarf_reg (i)] = i; } @@ -479,8 +481,8 @@ print_dwarf_state (int cfa_reg, int cfa_offset, int ip, int nregs, Loc *location } typedef struct { - Loc locations [NUM_REGS]; - guint8 reg_saved [NUM_REGS]; + Loc locations [NUM_HW_REGS]; + guint8 reg_saved [NUM_HW_REGS]; int cfa_reg, cfa_offset; } UnwindState; @@ -501,9 +503,9 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, mgreg_t **save_locations, int save_locations_len, guint8 **out_cfa) { - Loc locations [NUM_REGS]; - guint8 reg_saved [NUM_REGS]; - int i, pos, reg, cfa_reg = -1, cfa_offset = 0, offset; + Loc locations [NUM_HW_REGS]; + guint8 reg_saved [NUM_HW_REGS]; + int pos, reg, hwreg, cfa_reg = -1, cfa_offset = 0, offset; guint8 *p; guint8 *cfa_val; UnwindState state_stack [1]; @@ -528,11 +530,11 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, p ++; break; case DW_CFA_offset: - reg = *p & 0x3f; + hwreg = mono_dwarf_reg_to_hw_reg (*p & 0x3f); p ++; - reg_saved [reg] = TRUE; - locations [reg].loc_type = LOC_OFFSET; - locations [reg].offset = decode_uleb128 (p, &p) * DWARF_DATA_ALIGN; + reg_saved [hwreg] = TRUE; + locations [hwreg].loc_type = LOC_OFFSET; + locations [hwreg].offset = decode_uleb128 (p, &p) * DWARF_DATA_ALIGN; break; case 0: { int ext_op = *p; @@ -550,23 +552,25 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, break; case DW_CFA_offset_extended_sf: reg = decode_uleb128 (p, &p); + hwreg = mono_dwarf_reg_to_hw_reg (reg); offset = decode_sleb128 (p, &p); - g_assert (reg < NUM_REGS); - reg_saved [reg] = TRUE; - locations [reg].loc_type = LOC_OFFSET; - locations [reg].offset = offset * DWARF_DATA_ALIGN; + g_assert (reg < NUM_DWARF_REGS); + reg_saved [hwreg] = TRUE; + locations [hwreg].loc_type = LOC_OFFSET; + locations [hwreg].offset = offset * DWARF_DATA_ALIGN; break; case DW_CFA_offset_extended: reg = decode_uleb128 (p, &p); + hwreg = mono_dwarf_reg_to_hw_reg (reg); offset = decode_uleb128 (p, &p); - g_assert (reg < NUM_REGS); - reg_saved [reg] = TRUE; - locations [reg].loc_type = LOC_OFFSET; - locations [reg].offset = offset * DWARF_DATA_ALIGN; + g_assert (reg < NUM_DWARF_REGS); + reg_saved [hwreg] = TRUE; + locations [hwreg].loc_type = LOC_OFFSET; + locations [hwreg].offset = offset * DWARF_DATA_ALIGN; break; case DW_CFA_same_value: - reg = decode_uleb128 (p, &p); - locations [reg].loc_type = LOC_SAME; + hwreg = mono_dwarf_reg_to_hw_reg (decode_uleb128 (p, &p)); + locations [hwreg].loc_type = LOC_SAME; break; case DW_CFA_advance_loc1: pos += *p; @@ -615,16 +619,16 @@ mono_unwind_frame (guint8 *unwind_info, guint32 unwind_info_len, g_assert (cfa_reg != -1); cfa_val = (guint8*)regs [mono_dwarf_reg_to_hw_reg (cfa_reg)] + cfa_offset; - for (i = 0; i < NUM_REGS; ++i) { - if (reg_saved [i] && locations [i].loc_type == LOC_OFFSET) { - int hreg = mono_dwarf_reg_to_hw_reg (i); - g_assert (hreg < nregs); - if (IS_DOUBLE_REG (i)) - regs [hreg] = *(guint64*)(cfa_val + locations [i].offset); + for (hwreg = 0; hwreg < NUM_HW_REGS; ++hwreg) { + if (reg_saved [hwreg] && locations [hwreg].loc_type == LOC_OFFSET) { + int dwarfreg = mono_hw_reg_to_dwarf_reg (hwreg); + g_assert (hwreg < nregs); + if (IS_DOUBLE_REG (dwarfreg)) + regs [hwreg] = *(guint64*)(cfa_val + locations [hwreg].offset); else - regs [hreg] = *(mgreg_t*)(cfa_val + locations [i].offset); - if (save_locations && hreg < save_locations_len) - save_locations [hreg] = (mgreg_t*)(cfa_val + locations [i].offset); + regs [hwreg] = *(mgreg_t*)(cfa_val + locations [hwreg].offset); + if (save_locations && hwreg < save_locations_len) + save_locations [hwreg] = (mgreg_t*)(cfa_val + locations [hwreg].offset); } } diff --git a/mono/mini/version.h b/mono/mini/version.h index dcc12485b7..c4f9f0ece7 100644 --- a/mono/mini/version.h +++ b/mono/mini/version.h @@ -1 +1 @@ -#define FULL_VERSION "Stable 4.8.0.395/df81fe4" +#define FULL_VERSION "Stable 4.8.0.425/038ff4a" diff --git a/msvc/libmono-static.vcxproj b/msvc/libmono-static.vcxproj index 5d638f1b8f..4452f520d2 100644 --- a/msvc/libmono-static.vcxproj +++ b/msvc/libmono-static.vcxproj @@ -96,7 +96,6 @@ - true diff --git a/po/mcs/de.gmo b/po/mcs/de.gmo index f2b005d8fbc7271f3d56c2f897bd1b4f133bca88..75cd6874f16dbb8a99ba4a1266771b6f9fbf907c 100644 GIT binary patch delta 19 acmbQIHBW29Q!X}31w#WXlg+QWjJW_r@&-cy delta 19 acmbQIHBW29Q!X}R1w#`n)6K8BjJW_r)&@cV diff --git a/po/mcs/de.po.REMOVED.git-id b/po/mcs/de.po.REMOVED.git-id index 24729594de..611b4d1c65 100644 --- a/po/mcs/de.po.REMOVED.git-id +++ b/po/mcs/de.po.REMOVED.git-id @@ -1 +1 @@ -d610898725042926616eda830bc1fe06716fddf4 \ No newline at end of file +fc8f922fb66c17c061d7664663832151cbac0511 \ No newline at end of file diff --git a/po/mcs/es.gmo b/po/mcs/es.gmo index eb71f492a77b0841e907926d0d1d1dce6d0a450e..26e804d61622ddbb156b165452213b3c70d2ac93 100644 GIT binary patch delta 19 acmX?Ef3kjqo+6v2f}w$x$z~J9sd4~IvIcno delta 19 acmX?Ef3kjqo+6vEf}x3(>1Gqfsd4~ImIinL diff --git a/po/mcs/es.po.REMOVED.git-id b/po/mcs/es.po.REMOVED.git-id index f515796466..7b4ac8911e 100644 --- a/po/mcs/es.po.REMOVED.git-id +++ b/po/mcs/es.po.REMOVED.git-id @@ -1 +1 @@ -00b28cb6852ac9514efee13af376b134bb9217cc \ No newline at end of file +eb4ed277b3f3e346e58116739805dfdba99ffc17 \ No newline at end of file diff --git a/po/mcs/ja.gmo b/po/mcs/ja.gmo index 471553221a3d36dabb76b1b3cdb8a4aae5d56d27..f4f09cc5ee7fadbf2f5d64098efaba0cac64b778 100644 GIT binary patch delta 21 ccmeyri1Gg-#tj_mY?ca!2397U`P2)w09tSc)c^nh delta 21 ccmeyri1Gg-#tj_mY{m+PCRV1K`P2)w09sTA)Bpeg diff --git a/po/mcs/ja.po.REMOVED.git-id b/po/mcs/ja.po.REMOVED.git-id index 2c62481701..d308c62f75 100644 --- a/po/mcs/ja.po.REMOVED.git-id +++ b/po/mcs/ja.po.REMOVED.git-id @@ -1 +1 @@ -1e18717b72da0faecb084537f1a558d66dee33a0 \ No newline at end of file +628c8f51c151de8ef5a072d79079c83a53d3db76 \ No newline at end of file diff --git a/po/mcs/mcs.pot b/po/mcs/mcs.pot index bb8f2b4bc4..cda0979bf4 100644 --- a/po/mcs/mcs.pot +++ b/po/mcs/mcs.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: mono 4.8.0\n" "Report-Msgid-Bugs-To: http://www.mono-project.com/Bugs\n" -"POT-Creation-Date: 2017-01-03 14:50+0000\n" +"POT-Creation-Date: 2017-01-09 10:40+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 aef7924c1b905552d129837af852753475e19ba2..7413e4dffd61bd351d700c38f85699dd09905ace 100644 GIT binary patch delta 21 dcmX@Po8{zgmJL$V*en$c4XjKyD@