mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-21 13:28:41 +00:00
Fixed TraceAssemblies
This commit is contained in:
parent
f213a72b8e
commit
98d8336882
5 changed files with 36 additions and 40 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ namespace Cosmos.TestRunner.Core
|
|||
"StackCorruptionDetectionEnabled:" + EnableStackCorruptionChecks,
|
||||
"StackCorruptionDetectionLevel:" + StackCorruptionChecksLevel,
|
||||
"DebugMode:Source",
|
||||
"TraceAssemblies:",
|
||||
"TraceAssemblies:" + TraceAssembliesLevel,
|
||||
"DebugCom:1",
|
||||
"UseNAsm:True",
|
||||
"OutputFilename:" + outputFile,
|
||||
|
|
|
|||
|
|
@ -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<string> KernelsToRun
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
Loading…
Reference in a new issue