Table of Contents

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

CallStack

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

bool

Machine

Gets the parent machine the thread is running in.

public CilVirtualMachine Machine { get; }

Property Value

CilVirtualMachine

Methods

Call(IMethodDescriptor, BitVector[])

Calls the provided method in the context of the virtual machine.

public BitVector? Call(IMethodDescriptor method, BitVector[] arguments)

Parameters

method IMethodDescriptor

The method to call.

arguments BitVector[]

The arguments.

Returns

BitVector

The return value, or null if 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

method IMethodDescriptor

The method to call.

arguments object[]

The arguments.

Returns

BitVector

The return value, or null if 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

method IMethodDescriptor

The method to call.

cancellationToken CancellationToken

A token that can be used for canceling the emulation.

arguments BitVector[]

The arguments.

Returns

BitVector

The return value, or null if 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

method IMethodDescriptor

The method to call.

cancellationToken CancellationToken

A token that can be used for canceling the emulation.

arguments object[]

The arguments.

Returns

BitVector

The return value, or null if 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

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A 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

cancellationToken CancellationToken

A token that can be used for canceling the emulation.

condition Predicate<CilExecutionContext>

A predicate that is evaluated on every step of the emulation, determining whether execution should continue.