From: Marcos Henrich Date: Mon, 18 Jul 2016 13:57:08 +0000 (+0100) Subject: [mono-symbolicate] Handle wrapper stackframes X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=876a906e427bf4c58ad7a5f3f9c9b37adbc6217c;p=mono.git [mono-symbolicate] Handle wrapper stackframes --- diff --git a/mcs/tools/mono-symbolicate/StackFrameData.cs b/mcs/tools/mono-symbolicate/StackFrameData.cs index cc9b44c91e4..ed5134709cd 100644 --- a/mcs/tools/mono-symbolicate/StackFrameData.cs +++ b/mcs/tools/mono-symbolicate/StackFrameData.cs @@ -1,3 +1,4 @@ +using System; using System.Text.RegularExpressions; using System.Globalization; @@ -14,6 +15,8 @@ namespace Mono public readonly uint MethodIndex; public readonly string Line; + public readonly bool IsValid; + public string File { get; private set; } public int LineNumber { get; private set; } @@ -27,6 +30,15 @@ namespace Mono Offset = offset; IsILOffset = isILOffset; MethodIndex = methodIndex; + + IsValid = true; + } + + private StackFrameData (string line) + { + LineNumber = -1; + + Line = line; } public static bool TryParse (string line, out StackFrameData stackFrame) @@ -34,8 +46,13 @@ namespace Mono stackFrame = null; var match = regex.Match (line); - if (!match.Success) + if (!match.Success) { + if (line.Trim ().StartsWith ("at ", StringComparison.InvariantCulture)) { + stackFrame = new StackFrameData (line); + return true; + } return false; + } string typeFullName, methodSignature; var methodStr = match.Groups ["Method"].Value.Trim (); diff --git a/mcs/tools/mono-symbolicate/symbolicate.cs b/mcs/tools/mono-symbolicate/symbolicate.cs index 0619a6f1cad..dea62ebe58d 100644 --- a/mcs/tools/mono-symbolicate/symbolicate.cs +++ b/mcs/tools/mono-symbolicate/symbolicate.cs @@ -145,11 +145,14 @@ namespace Mono aotid = aotidMetadata.Value; var linesMvid = ProcessLinesMVID (metadata); - var lineNumber = 0; + var lineNumber = -1; foreach (var sfData in stackFrames) { string mvid = null; + lineNumber++; + if (!sfData.IsValid) + continue; if (linesMvid.ContainsKey (lineNumber)) - mvid = linesMvid [lineNumber++]; + mvid = linesMvid [lineNumber]; symbolManager.TryResolveLocation (sfData, mvid, aotid);