Fixed TraceAssemblies

This commit is contained in:
Charles Betros 2016-01-16 12:53:37 -06:00
parent f213a72b8e
commit 98d8336882
5 changed files with 36 additions and 40 deletions

View file

@ -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 // 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! // one thing to keep in mind though, is that this only works with 1 kernel at a time!
//engine.RunIL2CPUInProcess = true; //engine.RunIL2CPUInProcess = true;
engine.TraceAssembliesLevel = TraceAssemblies.User;
engine.EnableStackCorruptionChecks = true; engine.EnableStackCorruptionChecks = true;
engine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters.ToString(); engine.StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters;
//engine.RunWithGDB = true; //engine.RunWithGDB = true;
//engine.StartBochsDebugGui = true; //engine.StartBochsDebugGui = true;

View file

@ -44,7 +44,7 @@ namespace Cosmos.TestRunner.Core
"StackCorruptionDetectionEnabled:" + EnableStackCorruptionChecks, "StackCorruptionDetectionEnabled:" + EnableStackCorruptionChecks,
"StackCorruptionDetectionLevel:" + StackCorruptionChecksLevel, "StackCorruptionDetectionLevel:" + StackCorruptionChecksLevel,
"DebugMode:Source", "DebugMode:Source",
"TraceAssemblies:", "TraceAssemblies:" + TraceAssembliesLevel,
"DebugCom:1", "DebugCom:1",
"UseNAsm:True", "UseNAsm:True",
"OutputFilename:" + outputFile, "OutputFilename:" + outputFile,

View file

@ -17,7 +17,8 @@ namespace Cosmos.TestRunner.Core
public bool RunWithGDB = false; public bool RunWithGDB = false;
public bool StartBochsDebugGui = false; public bool StartBochsDebugGui = false;
public bool EnableStackCorruptionChecks = true; public bool EnableStackCorruptionChecks = true;
public string StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters.ToString(); public TraceAssemblies TraceAssembliesLevel = TraceAssemblies.User;
public StackCorruptionDetectionLevel StackCorruptionChecksLevel = StackCorruptionDetectionLevel.MethodFooters;
public IEnumerable<string> KernelsToRun public IEnumerable<string> KernelsToRun
{ {

View file

@ -51,9 +51,10 @@ namespace Cosmos.Build.Common
public enum TraceAssemblies public enum TraceAssemblies
{ {
All, None = 0,
Cosmos, User = 1,
User Cosmos = 2,
All = 3
}; };
public enum DebugMode public enum DebugMode

View file

@ -1,6 +1,7 @@
//#define VMT_DEBUG //#define VMT_DEBUG
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.SymbolStore; using System.Diagnostics.SymbolStore;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -1564,49 +1565,42 @@ namespace Cosmos.IL2CPU
{ {
// Check options for Debug Level // Check options for Debug Level
// Set based on TracedAssemblies // 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")
{ if (TraceAssemblies < TraceAssemblies.Cosmos)
return;
}
else if (aNamespace.StartsWith("Microsoft.", StringComparison.InvariantCultureIgnoreCase))
{
return;
}
if (TraceAssemblies == TraceAssemblies.User)
{ {
//TODO: Maybe an attribute that could be used to turn tracing on and off //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 if (aNamespace.StartsWith("Cosmos.", StringComparison.InvariantCultureIgnoreCase))
// 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))
{ {
return; return;
} }
} }
} }
else
{
return;
}
}
else
{
return;
} }
// If we made it this far without a return, emit the Tracer // 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 // 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. // Breaking that frequently is of course, pointless and slow.