Skip to content

Commit

Permalink
Add GetThisInfo CrossBindingAdaptorType support
Browse files Browse the repository at this point in the history
  • Loading branch information
OocoO authored and liiir1985 committed Jan 29, 2024
1 parent af53891 commit 55178c8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions ILRuntime/Runtime/Debugger/DebugService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Microsoft.CodeAnalysis.CSharp.Syntax;
#endif
using System.Reflection;

using ILRuntime.Runtime.Enviorment;
#if DEBUG && !DISABLE_ILRUNTIME_DEBUG
using AutoList = System.Collections.Generic.List<object>;
#else
Expand Down Expand Up @@ -203,7 +203,19 @@ public unsafe string GetThisInfo(ILIntepreter intepreter)
var addr = *(long*)&arg->Value;
arg = (StackObject*)addr;
}
ILTypeInstance instance = arg->ObjectType != ObjectTypes.Null ? intepreter.Stack.ManagedStack[arg->Value] as ILTypeInstance : null;
ILTypeInstance instance = null;
if (arg->ObjectType != ObjectTypes.Null)
{
var box = intepreter.Stack.ManagedStack[arg->Value];
if (box is ILTypeInstance ilInstance)
{
instance = ilInstance;
}
else if (box is CrossBindingAdaptorType adaptor)
{
instance = adaptor.ILInstance;
}
}
if (instance == null)
return "null";
var fields = instance.Type.TypeDefinition.Fields;
Expand Down

0 comments on commit 55178c8

Please sign in to comment.