Class DebugUtils
A collection of utility methods to assist in debugging
Inheritance
Inherited Members
Namespace: CilTools.BytecodeAnalysis
Assembly: CilTools.BytecodeAnalysis.dll
Syntax
public static class DebugUtils
Methods
GetExecutingInstruction(StackFrame)
Gets an currently executing instruction corresponding to the specified stack frame
Declaration
public static CilInstruction GetExecutingInstruction(StackFrame sf)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.StackFrame | sf | A stack frame object |
Returns
Type | Description |
---|---|
CilInstruction | CIL instruction |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Source stack frame is null |
GetLastExecutedInstruction()
Gets a last executed instruction at the calling point of the code
Declaration
public static CilInstruction GetLastExecutedInstruction()
Returns
Type | Description |
---|---|
CilInstruction | CIL instruction |
GetLastExecutedInstruction(StackFrame)
Gets a last executed instruction corresponding to the specified stack frame
Declaration
public static CilInstruction GetLastExecutedInstruction(StackFrame sf)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.StackFrame | sf | A stack frame object |
Returns
Type | Description |
---|---|
CilInstruction | CIL instruction |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Source stack frame is null |
GetStackTrace()
Gets a stack trace at the calling point represented as CIL instructions
Declaration
public static IEnumerable<CilInstruction> GetStackTrace()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<CilInstruction> | A collection of CIL instructions corresponding to frames of a callstack |
GetStackTrace(StackTrace)
Gets a repesentation of the call stack as CIL instructions
Declaration
public static IEnumerable<CilInstruction> GetStackTrace(StackTrace trace)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.StackTrace | trace | Stack trace object |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<CilInstruction> | A collection of CIL instructions |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Source stack trace is null |
PrintStackTrace()
Prints a stack trace at the calling point, represented as a CIL code, into the standard output
Declaration
public static void PrintStackTrace()
PrintStackTrace(StackTrace, TextWriter)
Prints a stack trace, represented as a CIL code, into the specified TextWriter
Declaration
public static void PrintStackTrace(StackTrace trace, TextWriter target = null)
Parameters
Type | Name | Description |
---|---|---|
System.Diagnostics.StackTrace | trace | Source stack trace object |
System.IO.TextWriter | target | Target TextWriter object. If null or omitted, standard output will be used. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Source stack trace is null |