DkmClrModuleInstance.InterpretManagedMethod Method

Definition

Simulates the execution of a method on an object by interpreting the method's MSIL code. The result of the method will be returned back to the caller. However, unlike a function evaluation, in which the method is actually running in the target, interpreting a method does not actually execute the method, but instead, merely simulates the behavior of the method. Because the method never actually executes, any side effects resulting from the method's execution are discarded after the interpretation of the method is complete, leaving the target process in an identical state to that from before the call.

Location constraint: API must be called from a Monitor component (component level < 100,000).

This API was introduced in Visual Studio 12 RTM (DkmApiVersion.VS12RTM).

public:
 Microsoft::VisualStudio::Debugger::Clr::DkmILInterpreterValue ^ InterpretManagedMethod(Microsoft::VisualStudio::Debugger::Clr::DkmClrMethodId Method, System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::VisualStudio::Debugger::Clr::DkmClrType ^> ^ GenericTypeParameters, System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::VisualStudio::Debugger::Clr::DkmClrType ^> ^ GenericMethodParameters, Microsoft::VisualStudio::Debugger::Clr::DkmILInterpreterValue ^ ThisParameter, System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::VisualStudio::Debugger::Clr::DkmILInterpreterValue ^> ^ Parameters, int MaxInstructionCount, Microsoft::VisualStudio::Debugger::Clr::DkmILInterpreterOptions Options, [Runtime::InteropServices::Out] System::String ^ % ExceptionType);
public Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue InterpretManagedMethod (Microsoft.VisualStudio.Debugger.Clr.DkmClrMethodId Method, System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmClrType> GenericTypeParameters, System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmClrType> GenericMethodParameters, Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue ThisParameter, System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue> Parameters, int MaxInstructionCount, Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterOptions Options, out string ExceptionType);
member this.InterpretManagedMethod : Microsoft.VisualStudio.Debugger.Clr.DkmClrMethodId * System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmClrType> * System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmClrType> * Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue * System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue> * int * Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterOptions * string -> Microsoft.VisualStudio.Debugger.Clr.DkmILInterpreterValue
Public Function InterpretManagedMethod (Method As DkmClrMethodId, GenericTypeParameters As ReadOnlyCollection(Of DkmClrType), GenericMethodParameters As ReadOnlyCollection(Of DkmClrType), ThisParameter As DkmILInterpreterValue, Parameters As ReadOnlyCollection(Of DkmILInterpreterValue), MaxInstructionCount As Integer, Options As DkmILInterpreterOptions, ByRef ExceptionType As String) As DkmILInterpreterValue

Parameters

Method
DkmClrMethodId

[In] The method to be interpreted. This function does not support interpreting certain types of methods, including, but not limited to: - Methods that consume ref or out parameters - Methods whose implementation calls into native code via P/Invoke, COM interop, or some other means.

GenericTypeParameters
ReadOnlyCollection<DkmClrType>

[In,Optional] If the method belongs to a generic class, specifies the instantiations of the type's generic parameters.

GenericMethodParameters
ReadOnlyCollection<DkmClrType>

[In,Optional] If the method is generic, specifies the instantiations of the method's generic parameters.

ThisParameter
DkmILInterpreterValue

[In,Optional] If the method to be interpreted is non-static, specifies the non-null object instance that the method should be called on. If the method to be interpreted is a class constructor, this can be either null or non-null. A null this parameter on a class constructor will cause us to virtually create a new object and interpret the constructor. A non-null this parameter to a constructor will cause us to interpret the call to the constructor on the existing object.

Parameters
ReadOnlyCollection<DkmILInterpreterValue>

[In,Optional] Parameters to be passed into the function, excluding the 'this' parameter. This may be null if the function to be interpreted takes no parameters. If the function takes parameters, the length of this array must be equal to the number of parameters specified in the method signature.

MaxInstructionCount
Int32

[In] The maximum number of total IL instructions that we are allowed to interpret. The IL interpretation will be aborted with an error code of E_ABORT if the actual number of instructions exceeds this limit. This limit prevents Visual Studio from hanging if the code being interpreted enters an infinite loop.

Options
DkmILInterpreterOptions

[In] Additional options for the IL interpreter.

ExceptionType
String

[Out,Optional] If the method throws an unhandled exception, the type of the exception that got thrown.

Returns

[Out,Optional] The return value of the method. This will be null if the method returns void or throws an exception.

Applies to