Class CilThread
- Namespace
- Echo.Platforms.AsmResolver.Emulation
- Assembly
- Echo.Platforms.AsmResolver.dll
Represents a single execution thread in a virtualized .NET process.
public class CilThread
- Inheritance
-
CilThread
- Inherited Members
Properties
CallStack
Gets the current state of the call stack.
public CallStack CallStack { get; }
Property Value
Remarks
The call stack is also addressable from Echo.Memory.
IsAlive
Gets a value indicating whether the thread is alive and present in the parent machine.
public bool IsAlive { get; }
Property Value
Machine
Gets the parent machine the thread is running in.
public CilVirtualMachine Machine { get; }
Property Value
Methods
Call(IMethodDescriptor, BitVector[])
Calls the provided method in the context of the virtual machine.
public BitVector? Call(IMethodDescriptor method, BitVector[] arguments)
Parameters
methodIMethodDescriptorThe method to call.
argumentsBitVector[]The arguments.
Returns
- BitVector
The return value, or
nullif the provided method does not return a value.
Remarks
This method is blocking until the emulation of the call completes.
Call(IMethodDescriptor, object[])
Calls the provided method in the context of the virtual machine.
public BitVector? Call(IMethodDescriptor method, object[] arguments)
Parameters
methodIMethodDescriptorThe method to call.
argumentsobject[]The arguments.
Returns
- BitVector
The return value, or
nullif the provided method does not return a value.
Remarks
This method is blocking until the emulation of the call completes.
Call(IMethodDescriptor, CancellationToken, BitVector[])
Calls the provided method in the context of the virtual machine.
public BitVector? Call(IMethodDescriptor method, CancellationToken cancellationToken, BitVector[] arguments)
Parameters
methodIMethodDescriptorThe method to call.
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
argumentsBitVector[]The arguments.
Returns
- BitVector
The return value, or
nullif the provided method does not return a value.
Remarks
This method is blocking until the emulation of the call completes or the emulation is canceled.
Call(IMethodDescriptor, CancellationToken, object[])
Calls the provided method in the context of the virtual machine.
public BitVector? Call(IMethodDescriptor method, CancellationToken cancellationToken, object[] arguments)
Parameters
methodIMethodDescriptorThe method to call.
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
argumentsobject[]The arguments.
Returns
- BitVector
The return value, or
nullif the provided method does not return a value.
Remarks
This method is blocking until the emulation of the call completes.
Run()
Runs the virtual machine until it halts.
public void Run()
Run(CancellationToken)
Runs the virtual machine until it halts.
public void Run(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
Step()
Performs a single step in the virtual machine.
public void Step()
Step(CancellationToken)
Performs a single step in the virtual machine.
public void Step(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
StepOut()
Continues execution of the virtual machine until the current call frame is popped from the stack.
public void StepOut()
StepOut(CancellationToken)
Continues execution of the virtual machine until the current call frame is popped from the stack.
public void StepOut(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
StepOver()
Performs a single step in the virtual machine. If the current instruction performs a call, the emulation is treated as a single instruction.
public void StepOver()
StepOver(CancellationToken)
Performs a single step in the virtual machine. If the current instruction performs a call, the emulation is treated as a single instruction.
public void StepOver(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
StepWhile(CancellationToken, Predicate<CilExecutionContext>)
Continues execution of the virtual machine while the provided predicate returns true.
public void StepWhile(CancellationToken cancellationToken, Predicate<CilExecutionContext> condition)
Parameters
cancellationTokenCancellationTokenA token that can be used for canceling the emulation.
conditionPredicate<CilExecutionContext>A predicate that is evaluated on every step of the emulation, determining whether execution should continue.