mirror of
https://github.com/ZuneDev/MicrosoftIris.git
synced 2026-07-27 13:13:29 -07:00
More decompiler fixes
This commit is contained in:
+5
-5
@@ -5,9 +5,9 @@ using System;
|
||||
|
||||
namespace Microsoft.Iris.Debug
|
||||
{
|
||||
[RemoteProperty]
|
||||
[RemoteMethod]
|
||||
[RemoteOptions(RemotingDirection.Bidirectional)]
|
||||
//[RemoteProperty]
|
||||
//[RemoteMethod]
|
||||
//[RemoteOptions(RemotingDirection.Bidirectional)]
|
||||
public class Bridge : IBridge, IDisposable
|
||||
{
|
||||
private readonly MemberRemote _memberRemote;
|
||||
@@ -24,13 +24,13 @@ namespace Microsoft.Iris.Debug
|
||||
_memberRemote = new MemberRemote(this, typeof(Bridge).Assembly.FullName, handler);
|
||||
}
|
||||
|
||||
[RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)]
|
||||
//[RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)]
|
||||
public void LogInterpreterOpCode(object context, Data.InterpreterEntry entry)
|
||||
{
|
||||
InterpreterStep?.Invoke(context, new(entry));
|
||||
}
|
||||
|
||||
[RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)]
|
||||
//[RemoteMethod, RemoteOptions(RemotingDirection.HostToClient)]
|
||||
public void LogDispatcher(string message)
|
||||
{
|
||||
DispatcherStep?.Invoke(message);
|
||||
|
||||
@@ -22,13 +22,14 @@ namespace Microsoft.Iris.Debug.Data
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
var args =
|
||||
#if OPENZUNE
|
||||
Arguments;
|
||||
var args = Arguments;
|
||||
var ret = ReturnValues;
|
||||
#else
|
||||
Arguments.Select(a => a.ToString()).ToArray();
|
||||
var args = Arguments.Select(a => a.ToString()).ToArray();
|
||||
var ret = ReturnValues.Select(a => a.ToString()).ToArray();
|
||||
#endif
|
||||
return $"{OpCode}({string.Join(", ", args)})";
|
||||
return $"{OpCode}({string.Join(", ", args)}) -> [{ReturnValues}]";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace Microsoft.Iris.Debug
|
||||
|
||||
public Bridge Bridge { get; } =
|
||||
#if OPENZUNE
|
||||
new(OwlCore.Remoting.RemotingMode.Host);
|
||||
new(OwlCore.Remoting.RemotingMode.None);
|
||||
#else
|
||||
new();
|
||||
#endif
|
||||
|
||||
@@ -1022,6 +1022,7 @@ namespace Microsoft.Iris.Markup
|
||||
TypeSchema typeSchema8 = (TypeSchema)stack.Pop();
|
||||
object obj7 = stack.Pop();
|
||||
typeSchema8.InitializeInstance(ref obj7);
|
||||
xmlStack.Pop();
|
||||
var objXml7 = (XmlElement)xmlStack.Pop();
|
||||
objXml7.SetAttribute("Name", typeSchema8.Name);
|
||||
ReportErrorOnNull(obj7, "Initialize", typeSchema8.Name);
|
||||
@@ -1055,6 +1056,7 @@ namespace Microsoft.Iris.Markup
|
||||
case OpCode.WriteSymbolPeek:
|
||||
{
|
||||
object value = (opCode == OpCode.WriteSymbolPeek) ? stack.Peek() : stack.Pop();
|
||||
if (opCode == OpCode.WriteSymbol) xmlStack.Pop();
|
||||
int num9 = reader.ReadUInt16();
|
||||
SymbolReference symbolRef2 = symbolReferenceTable[num9];
|
||||
|
||||
@@ -1088,6 +1090,7 @@ namespace Microsoft.Iris.Markup
|
||||
if (isPropInitIndirect)
|
||||
{
|
||||
typeSchema9 = (TypeSchema)stack.Pop();
|
||||
xmlStack.Pop();
|
||||
}
|
||||
int num11 = reader.ReadUInt16();
|
||||
PropertySchema propertySchema = importTables.PropertyImports[num11];
|
||||
@@ -1146,6 +1149,8 @@ namespace Microsoft.Iris.Markup
|
||||
// Add value to list
|
||||
var destObjXml = xmlStack.Peek();
|
||||
if (!IsDefaultValue(value2) && valueXml2 != null)
|
||||
{
|
||||
if (propertySchema != null)
|
||||
{
|
||||
// Create element if needed
|
||||
if (destObjXml.SelectSingleNode(propertySchema.Name) is not XmlElement propXmlElem2)
|
||||
@@ -1155,6 +1160,14 @@ namespace Microsoft.Iris.Markup
|
||||
}
|
||||
propXmlElem2.AppendChild(valueXml2);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Add straight to parent element
|
||||
var valueXmlElem2 = XmlDoc.CreateElement("String");
|
||||
valueXmlElem2.AppendChild(valueXml2);
|
||||
destObjXml.AppendChild(valueXmlElem2);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1238,13 +1251,13 @@ namespace Microsoft.Iris.Markup
|
||||
PropertySchema propertySchema4 = importTables.PropertyImports[num13];
|
||||
|
||||
object instance3 = null;
|
||||
XmlElement xmlInstance3 = null;
|
||||
|
||||
if (opCode != OpCode.PropertyGetStatic)
|
||||
{
|
||||
bool pop = opCode == OpCode.PropertyGet;
|
||||
instance3 = pop ? stack.Pop() : stack.Peek();
|
||||
xmlInstance3 = (XmlElement)(pop ? xmlStack.Pop() : xmlStack.Peek());
|
||||
if (pop) xmlStack.Pop();
|
||||
|
||||
ReportErrorOnNullOrDisposed(instance3, "Property Get", propertySchema4.Name, propertySchema4.Owner);
|
||||
if (ErrorsDetected(watermark, ref result, ref flag))
|
||||
{
|
||||
@@ -1683,12 +1696,20 @@ namespace Microsoft.Iris.Markup
|
||||
if (!prop.CanWrite || !prop.CanRead)
|
||||
continue;
|
||||
|
||||
try
|
||||
{
|
||||
object value = prop.GetValue(obj, null);
|
||||
if (IsDefaultValue(value))
|
||||
continue;
|
||||
|
||||
SetXmlPropValue(objXml, prop.Name, value, recursionLevel - 1);
|
||||
}
|
||||
catch
|
||||
{
|
||||
// Ignore errors, sometimes things aren't initialized yet
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
return objXml;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user