private static void StoreSymbolsAction(List <string> args) { var msymDir = args[0]; var lookupDirs = args.Skip(1).ToArray(); var symbolManager = new SymbolManager(msymDir, logger); symbolManager.StoreSymbols(lookupDirs); }
private static void SymbolicateAction (List<string> args) { var msymDir = args [0]; var inputFile = args [1]; var symbolManager = new SymbolManager (msymDir, logger); using (StreamReader r = new StreamReader (inputFile)) { var sb = Process (r, symbolManager); Console.Write (sb.ToString ()); } }
private static void SymbolicateAction(List <string> args) { var msymDir = args [0]; var inputFile = args [1]; var symbolManager = new SymbolManager(msymDir, logger); using (StreamReader r = new StreamReader(inputFile)) { var sb = Process(r, symbolManager); Console.Write(sb.ToString()); } }
public static StringBuilder Process(StreamReader reader, SymbolManager symbolManager) { List <StackFrameData> stackFrames = new List <StackFrameData>(); List <StackTraceMetadata> metadata = new List <StackTraceMetadata>(); StringBuilder sb = new StringBuilder(); bool linesEnded = false; for (var line = reader.ReadLine(); line != null; line = reader.ReadLine()) { StackFrameData sfData; if (!linesEnded && StackFrameData.TryParse(line, out sfData)) { stackFrames.Add(sfData); continue; } if (stackFrames.Count > 0) { linesEnded = true; StackTraceMetadata stMetadata; if (StackTraceMetadata.TryParse(line, out stMetadata)) { metadata.Add(stMetadata); continue; } DumpStackTrace(symbolManager, sb, stackFrames, metadata); // Clear lists for next stack trace stackFrames.Clear(); metadata.Clear(); } linesEnded = false; // Append last line sb.AppendLine(line); } if (stackFrames.Count > 0) { DumpStackTrace(symbolManager, sb, stackFrames, metadata); } return(sb); }
private static void SymbolicateAction (List<string> args) { var msymDir = args [0]; var inputFile = args [1]; var symbolManager = new SymbolManager (msymDir, logger); using (StreamReader r = new StreamReader (inputFile)) { for (var line = r.ReadLine (); line != null; line = r.ReadLine ()) { StackFrameData sfData; if (StackFrameData.TryParse (line, out sfData) && symbolManager.TryResolveLocation (sfData)) { Console.WriteLine (sfData.ToString ()); continue; } Console.WriteLine (line); } } }
private static void SymbolicateAction(List <string> args) { var msymDir = args [0]; var inputFile = args [1]; var symbolManager = new SymbolManager(msymDir, logger); using (StreamReader r = new StreamReader(inputFile)) { for (var line = r.ReadLine(); line != null; line = r.ReadLine()) { if (StackFrameData.TryParse(line, out var sfData) && symbolManager.TryResolveLocation(sfData, out var location)) { var sign = sfData.Line.Substring(0, sfData.Line.IndexOf(" in <", StringComparison.Ordinal)); line = $"{sign} in {location.File}:{location.Line}"; } Console.WriteLine(line); } } }
private static void SymbolicateAction(List <string> args) { var msymDir = args [0]; var inputFile = args [1]; var symbolManager = new SymbolManager(msymDir, logger); using (StreamReader r = new StreamReader(inputFile)) { for (var line = r.ReadLine(); line != null; line = r.ReadLine()) { StackFrameData sfData; if (StackFrameData.TryParse(line, out sfData) && symbolManager.TryResolveLocation(sfData)) { Console.WriteLine(sfData.ToString()); continue; } Console.WriteLine(line); } } }
private static void DumpStackTrace(SymbolManager symbolManager, StringBuilder sb, List <StackFrameData> stackFrames, List <StackTraceMetadata> metadata) { string aotid = null; var aotidMetadata = metadata.FirstOrDefault(m => m.Id == "AOTID"); if (aotidMetadata != null) { aotid = aotidMetadata.Value; } var linesMvid = ProcessLinesMVID(metadata); var lineNumber = -1; foreach (var sfData in stackFrames) { string mvid = null; lineNumber++; if (!sfData.IsValid) { continue; } if (linesMvid.ContainsKey(lineNumber)) { mvid = linesMvid [lineNumber]; } symbolManager.TryResolveLocation(sfData, mvid, aotid); sb.AppendLine(sfData.ToString()); } foreach (var m in metadata) { sb.AppendLine(m.Line); } }
public static StringBuilder Process (StreamReader reader, SymbolManager symbolManager) { List<StackFrameData> stackFrames = new List<StackFrameData>(); List<StackTraceMetadata> metadata = new List<StackTraceMetadata>(); StringBuilder sb = new StringBuilder (); bool linesEnded = false; for (var line = reader.ReadLine (); line != null; line = reader.ReadLine ()) { StackFrameData sfData; if (!linesEnded && StackFrameData.TryParse (line, out sfData)) { stackFrames.Add (sfData); continue; } if (stackFrames.Count > 0) { linesEnded = true; StackTraceMetadata stMetadata; if (StackTraceMetadata.TryParse (line, out stMetadata)) { metadata.Add (stMetadata); continue; } DumpStackTrace (symbolManager, sb, stackFrames, metadata); // Clear lists for next stack trace stackFrames.Clear (); metadata.Clear (); } linesEnded = false; // Append last line sb.AppendLine (line); } if (stackFrames.Count > 0) DumpStackTrace (symbolManager, sb, stackFrames, metadata); return sb; }
private static void StoreSymbolsAction (List<string> args) { var msymDir = args[0]; var lookupDirs = args.Skip (1).ToArray (); var symbolManager = new SymbolManager (msymDir, logger); symbolManager.StoreSymbols (lookupDirs); }
private static void DumpStackTrace (SymbolManager symbolManager, StringBuilder sb, List<StackFrameData> stackFrames, List<StackTraceMetadata> metadata) { string aotid = null; var aotidMetadata = metadata.FirstOrDefault ( m => m.Id == "AOTID" ); if (aotidMetadata != null) aotid = aotidMetadata.Value; var linesMvid = ProcessLinesMVID (metadata); var lineNumber = -1; foreach (var sfData in stackFrames) { string mvid = null; lineNumber++; if (!sfData.IsValid) continue; if (linesMvid.ContainsKey (lineNumber)) mvid = linesMvid [lineNumber]; symbolManager.TryResolveLocation (sfData, mvid, aotid); sb.AppendLine (sfData.ToString ()); } foreach (var m in metadata) sb.AppendLine (m.Line); }