using System; using System.Collections.Generic; using System.Linq; using System.Text; using Cosmos.Build.MSBuild; using Microsoft.Build.Framework; using System.Diagnostics; using System.Data.SQLite; using Cosmos.Debug.Common; namespace DebugCompiler { class Program { public const string OutputRoot = @"C:\Users\Huge\Documents\Visual Studio 2010\Projects\IL2CPU"; //static void Main(string[] args) //{ // var xTimespans = new List(); // #region Bench // for (int i = 0; i < 1; i++) // { // var xSW = Stopwatch.StartNew(); // try // { // var xTask = new IL2CPUTask(); // xTask.DebugEnabled = true; // xTask.DebugMode = "Source"; // xTask.TraceAssemblies = "User"; // xTask.DebugCom = 1; // xTask.UseNAsm = true; // xTask.OutputFilename = OutputRoot + @"\source2\users\Matthijs\Playground\bin\Debug\PlaygroundBoot.asm"; // xTask.EnableLogging = true; // xTask.EnableLogging = false; // xTask.EmitDebugSymbols = true; // xTask.IgnoreDebugStubAttribute = false; // xTask.References = GetReferences(); // xTask.OnLogError = (m) => Console.WriteLine("Error: {0}", m); // xTask.OnLogWarning = (m) => Console.WriteLine("Warning: {0}", m); // xTask.OnLogMessage = (m) => Console.WriteLine("Message: {0}", m); // xTask.OnLogException = (m) => // { // Console.WriteLine("Exception: {0}", m.ToString()); // Console.ReadLine(); // }; // if (xTask.Execute()) // { // Console.WriteLine("Executed OK"); // } // else // { // Console.WriteLine("Errorred"); // } // xSW.Stop(); // xTimespans.Add(xSW.Elapsed); // } // catch (Exception E) // { // Console.WriteLine(E.ToString()); // Console.ReadLine(); // return; // } // } // #endregion Bench // for (int i = 0; i < xTimespans.Count; i++) // { // Console.WriteLine("Run {0} took {1}", i + 1, xTimespans[i].ToString()); // } //} static void Main() { var di = new DebugInfo(@"C:\Users\Huge\Documents\Visual Studio 2010\Projects\IL2CPU\source2\Demos\Guess\bin\Debug\Guess.cdb"); di.LoadLookups(); } static void SQLiteLog_Log(object sender, LogEventArgs e) { Console.WriteLine("SQL: {0}", e.Message); } private static ITaskItem[] GetReferences() { return new ITaskItem[]{ new TaskItemImpl(OutputRoot + @"\source2\Users\Matthijs\Playground\bin\Debug\Playground.dll"), new TaskItemImpl(OutputRoot + @"\source2\Kernel\System\Hardware\Core\Cosmos.Core.Plugs\bin\x86\Debug\Cosmos.Core.Plugs.dll"), new TaskItemImpl(OutputRoot + @"\source2\Kernel\Debug\Cosmos.Debug.Kernel.Plugs\bin\x86\Debug\Cosmos.Debug.Kernel.Plugs.dll"), new TaskItemImpl(OutputRoot + @"\source2\Kernel\System\Cosmos.System.Plugs.System\bin\x86\Debug\Cosmos.System.Plugs.System.dll") }; } private class TaskItemImpl : ITaskItem { private string path; public TaskItemImpl(string path) { this.path = path; } public System.Collections.IDictionary CloneCustomMetadata() { throw new NotImplementedException(); } public void CopyMetadataTo(ITaskItem destinationItem) { throw new NotImplementedException(); } public string GetMetadata(string metadataName) { if (metadataName == "FullPath") { return path; } throw new NotImplementedException(); } public string ItemSpec { get { throw new NotImplementedException(); } set { throw new NotImplementedException(); } } public int MetadataCount { get { return MetadataNames.Count; } } public System.Collections.ICollection MetadataNames { get { return new String[] { "FullPath" }; } } public void RemoveMetadata(string metadataName) { throw new NotImplementedException(); } public void SetMetadata(string metadataName, string metadataValue) { throw new NotImplementedException(); } } } }