diff --git a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs index 04cc356bc..345ee2745 100644 --- a/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs +++ b/Tests/Cosmos.TestRunner.Core/DefaultEngineConfiguration.cs @@ -23,9 +23,9 @@ namespace Cosmos.TestRunner.Core // If you're working on the compiler (or other lower parts), you can choose to run the compiler in process // one thing to keep in mind though, is that this only works with 1 kernel at a time! //engine.RunIL2CPUInProcess = true; - + engine.TraceAssembliesLevel = TraceAssemblies.User; engine.EnableStackCorruptionChecks = true; - engine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters.ToString(); + engine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters; //engine.RunWithGDB = true; //engine.StartBochsDebugGui = true; diff --git a/Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs b/Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs index 4fb70efc3..2ffb49367 100644 --- a/Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs +++ b/Tests/Cosmos.TestRunner.Core/Engine.Helpers.cs @@ -44,7 +44,7 @@ namespace Cosmos.TestRunner.Core "StackCorruptionDetectionEnabled:" + EnableStackCorruptionChecks, "StackCorruptionDetectionLevel:" + StackCorruptionChecksLevel, "DebugMode:Source", - "TraceAssemblies:", + "TraceAssemblies:" + TraceAssembliesLevel, "DebugCom:1", "UseNAsm:True", "OutputFilename:" + outputFile, diff --git a/Tests/Cosmos.TestRunner.Core/Engine.cs b/Tests/Cosmos.TestRunner.Core/Engine.cs index d173cc68c..d37ae3ab5 100644 --- a/Tests/Cosmos.TestRunner.Core/Engine.cs +++ b/Tests/Cosmos.TestRunner.Core/Engine.cs @@ -17,7 +17,8 @@ namespace Cosmos.TestRunner.Core public bool RunWithGDB = false; public bool StartBochsDebugGui = false; public bool EnableStackCorruptionChecks = true; - public string StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters.ToString(); + public TraceAssemblies TraceAssembliesLevel = TraceAssemblies.User; + public StackCorruptionDetectionLevel StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters; public IEnumerable KernelsToRun { diff --git a/source/Cosmos.Build.Common/Enums.cs b/source/Cosmos.Build.Common/Enums.cs index 3ee47d265..5e2c97e8e 100644 --- a/source/Cosmos.Build.Common/Enums.cs +++ b/source/Cosmos.Build.Common/Enums.cs @@ -51,9 +51,10 @@ namespace Cosmos.Build.Common public enum TraceAssemblies { - All, - Cosmos, - User + None = 0, + User = 1, + Cosmos = 2, + All = 3 }; public enum DebugMode @@ -111,4 +112,4 @@ namespace Cosmos.Build.Common get { return emDescription; } } } -} \ No newline at end of file +} diff --git a/source/Cosmos.IL2CPU/AppAssembler.cs b/source/Cosmos.IL2CPU/AppAssembler.cs index 2672ca1ad..4b043dca2 100644 --- a/source/Cosmos.IL2CPU/AppAssembler.cs +++ b/source/Cosmos.IL2CPU/AppAssembler.cs @@ -1,6 +1,7 @@ //#define VMT_DEBUG using System; using System.Collections.Generic; +using System.Diagnostics; using System.Diagnostics.SymbolStore; using System.IO; using System.Linq; @@ -1564,49 +1565,42 @@ namespace Cosmos.IL2CPU { // Check options for Debug Level // Set based on TracedAssemblies - if (TraceAssemblies == TraceAssemblies.Cosmos || TraceAssemblies == TraceAssemblies.User) + if (TraceAssemblies > TraceAssemblies.None) { - if (aNamespace.StartsWith("System.", StringComparison.InvariantCultureIgnoreCase)) + if (TraceAssemblies < TraceAssemblies.All) { - return; + if (aNamespace.StartsWith("System.", StringComparison.InvariantCultureIgnoreCase)) + { + return; + } + if (aNamespace.ToLower() == "system") + { + return; + } + if (aNamespace.StartsWith("Microsoft.", StringComparison.InvariantCultureIgnoreCase)) + { + return; + } } - else if (aNamespace.ToLower() == "system") - { - return; - } - else if (aNamespace.StartsWith("Microsoft.", StringComparison.InvariantCultureIgnoreCase)) - { - return; - } - if (TraceAssemblies == TraceAssemblies.User) + + if (TraceAssemblies < TraceAssemblies.Cosmos) { //TODO: Maybe an attribute that could be used to turn tracing on and off - //TODO: This doesnt match Cosmos.Kernel exact vs Cosmos.Kernel., so a user - // could do Cosmos.KernelMine and it will fail. Need to fix this - if (aNamespace.StartsWith("Cosmos.Kernel", StringComparison.InvariantCultureIgnoreCase)) - { - return; - } - else if (aNamespace.StartsWith("Cosmos.System", StringComparison.InvariantCultureIgnoreCase)) - { - return; - } - else if (aNamespace.StartsWith("Cosmos.HAL", StringComparison.InvariantCultureIgnoreCase)) - { - return; - } - else if (aNamespace.StartsWith("Cosmos.Core", StringComparison.InvariantCultureIgnoreCase)) - { - return; - } - else if (aNamespace.StartsWith("Cosmos.IL2CPU", StringComparison.InvariantCultureIgnoreCase)) + if (aNamespace.StartsWith("Cosmos.", StringComparison.InvariantCultureIgnoreCase)) { return; } } } + else + { + return; + } + } + else + { + return; } - // If we made it this far without a return, emit the Tracer // We used to emit an INT3, but this meant the DS would brwak after every C# line // Breaking that frequently is of course, pointless and slow.