mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
Switched to DebugSettings
This commit is contained in:
@@ -135,7 +135,7 @@ namespace Microsoft.Iris
|
|||||||
get => DllResources.StaticDllResourcesOnly;
|
get => DllResources.StaticDllResourcesOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static bool IsDebug { get; set; }
|
public static Debug.DebugSettings DebugSettings { get; set; }
|
||||||
|
|
||||||
public static void Initialize()
|
public static void Initialize()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Microsoft.Iris.Debug
|
||||||
|
{
|
||||||
|
public class DebugSettings
|
||||||
|
{
|
||||||
|
public bool UseDecompiler { get; set; } = false;
|
||||||
|
public bool OpenDebugPipe { get; set; } = false;
|
||||||
|
public List<System.Xml.XmlDocument> DecompileResults { get; } = new List<System.Xml.XmlDocument>();
|
||||||
|
public TraceSettings TraceSettings { get; } = TraceSettings.Current;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,7 +25,7 @@ namespace Microsoft.Iris.Markup
|
|||||||
byteCodeReader = context.LoadResult.ObjectSection;
|
byteCodeReader = context.LoadResult.ObjectSection;
|
||||||
num = (long)((ulong)byteCodeReader.CurrentOffset);
|
num = (long)((ulong)byteCodeReader.CurrentOffset);
|
||||||
byteCodeReader.CurrentOffset = context.InitialBytecodeOffset;
|
byteCodeReader.CurrentOffset = context.InitialBytecodeOffset;
|
||||||
if (InterpreterContext.UseDecompile)
|
if (Application.DebugSettings.UseDecompiler)
|
||||||
result = RunDecompile(context, byteCodeReader);
|
result = RunDecompile(context, byteCodeReader);
|
||||||
else
|
else
|
||||||
result = Run(context, byteCodeReader);
|
result = Run(context, byteCodeReader);
|
||||||
@@ -1561,7 +1561,7 @@ namespace Microsoft.Iris.Markup
|
|||||||
}
|
}
|
||||||
|
|
||||||
CleanUpXmlDoc();
|
CleanUpXmlDoc();
|
||||||
InterpreterContext.DecompileResults.Add(XmlDoc);
|
Application.DebugSettings.DecompileResults.Add(XmlDoc);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,8 +19,6 @@ namespace Microsoft.Iris.Markup
|
|||||||
private ParameterContext _parameterContext;
|
private ParameterContext _parameterContext;
|
||||||
private Map<object, object> _scopedLocals;
|
private Map<object, object> _scopedLocals;
|
||||||
private static Stack s_cache = new Stack();
|
private static Stack s_cache = new Stack();
|
||||||
public static bool UseDecompile = false;
|
|
||||||
public static List<System.Xml.XmlDocument> DecompileResults = new List<System.Xml.XmlDocument>();
|
|
||||||
|
|
||||||
private InterpreterContext()
|
private InterpreterContext()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ namespace Microsoft.Iris.Queues
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (_debugPipe == null && Application.IsDebug)
|
if (_debugPipe == null && Application.DebugSettings.OpenDebugPipe)
|
||||||
{
|
{
|
||||||
_debugPipe = new NamedPipeClientStream(System.Reflection.Assembly.GetExecutingAssembly().FullName);
|
_debugPipe = new NamedPipeClientStream(System.Reflection.Assembly.GetExecutingAssembly().FullName);
|
||||||
_debugPipe.Connect();
|
_debugPipe.Connect();
|
||||||
@@ -180,7 +180,7 @@ namespace Microsoft.Iris.Queues
|
|||||||
/// <param name="message"></param>
|
/// <param name="message"></param>
|
||||||
public static void SendDebugMessage(string message)
|
public static void SendDebugMessage(string message)
|
||||||
{
|
{
|
||||||
if (Application.IsDebug && DebugPipe.IsConnected && DebugPipe.CanWrite)
|
if (Application.DebugSettings.OpenDebugPipe && DebugPipe.IsConnected && DebugPipe.CanWrite)
|
||||||
{
|
{
|
||||||
DebugPipe.WriteByte(0x01);
|
DebugPipe.WriteByte(0x01);
|
||||||
byte[] buffer = System.Text.Encoding.Unicode.GetBytes(message);
|
byte[] buffer = System.Text.Encoding.Unicode.GetBytes(message);
|
||||||
|
|||||||
Reference in New Issue
Block a user