using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using Microsoft.Build.Framework; using Microsoft.Build.Utilities; using IL2CPU.Debug.Symbols; namespace Cosmos.Build.Tasks { public class ReadNasmMapToDebugInfo : Task { [Required] public string MapFile { get; set; } [Required] public string DebugInfoFile { get; set; } public override bool Execute() { var xSW = Stopwatch.StartNew(); try { var xSourceInfos = ParseMapFile(MapFile); if (xSourceInfos.Count == 0) { Log.LogError("No SourceInfos found!"); return false; } using (var xDebugInfo = new DebugInfo(DebugInfoFile)) { xDebugInfo.AddLabels(xSourceInfos); xDebugInfo.CreateIndexes(); } return true; } catch (Exception ex) { Log.LogErrorFromException(ex, true, true, null); return false; } finally { xSW.Stop(); Log.LogMessage(MessageImportance.High, "ReadNasmMapToDebugInfo task took {0}", xSW.Elapsed); } } private static List