mscorlib(4.0.0.0) API with additions
System.Diagnostics.StackFrame Class Reference

Provides information about a T:System.Diagnostics.StackFrame, which represents a function call on the call stack for the current thread. More...

Public Member Functions

 StackFrame ()
 Initializes a new instance of the T:System.Diagnostics.StackFrame class. More...
 
 StackFrame (bool fNeedFileInfo)
 Initializes a new instance of the T:System.Diagnostics.StackFrame class, optionally capturing source information. More...
 
 StackFrame (int skipFrames)
 Initializes a new instance of the T:System.Diagnostics.StackFrame class that corresponds to a frame above the current stack frame. More...
 
 StackFrame (int skipFrames, bool fNeedFileInfo)
 Initializes a new instance of the T:System.Diagnostics.StackFrame class that corresponds to a frame above the current stack frame, optionally capturing source information. More...
 
 StackFrame (string fileName, int lineNumber)
 Initializes a new instance of the T:System.Diagnostics.StackFrame class that contains only the given file name and line number. More...
 
 StackFrame (string fileName, int lineNumber, int colNumber)
 Initializes a new instance of the T:System.Diagnostics.StackFrame class that contains only the given file name, line number, and column number. More...
 
virtual MethodBase GetMethod ()
 Gets the method in which the frame is executing. More...
 
virtual int GetNativeOffset ()
 Gets the offset from the start of the native just-in-time (JIT)-compiled code for the method that is being executed. The generation of this debugging information is controlled by the T:System.Diagnostics.DebuggableAttribute class. More...
 
virtual int GetILOffset ()
 Gets the offset from the start of the Microsoft intermediate language (MSIL) code for the method that is executing. This offset might be an approximation depending on whether or not the just-in-time (JIT) compiler is generating debugging code. The generation of this debugging information is controlled by the T:System.Diagnostics.DebuggableAttribute. More...
 
virtual string GetFileName ()
 Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. More...
 
virtual int GetFileLineNumber ()
 Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. More...
 
virtual int GetFileColumnNumber ()
 Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. More...
 
override string ToString ()
 Builds a readable representation of the stack trace. More...
 

Public Attributes

const int OFFSET_UNKNOWN = -1
 Defines the value that is returned from the M:System.Diagnostics.StackFrame.GetNativeOffset or M:System.Diagnostics.StackFrame.GetILOffset method when the native or Microsoft intermediate language (MSIL) offset is unknown. This field is constant. More...
 

Detailed Description

Provides information about a T:System.Diagnostics.StackFrame, which represents a function call on the call stack for the current thread.

Definition at line 14 of file StackFrame.cs.

Constructor & Destructor Documentation

◆ StackFrame() [1/6]

System.Diagnostics.StackFrame.StackFrame ( )

Initializes a new instance of the T:System.Diagnostics.StackFrame class.

Definition at line 46 of file StackFrame.cs.

◆ StackFrame() [2/6]

System.Diagnostics.StackFrame.StackFrame ( bool  fNeedFileInfo)

Initializes a new instance of the T:System.Diagnostics.StackFrame class, optionally capturing source information.

Parameters
fNeedFileInfotrue to capture the file name, line number, and column number of the stack frame; otherwise, false.

Definition at line 55 of file StackFrame.cs.

◆ StackFrame() [3/6]

System.Diagnostics.StackFrame.StackFrame ( int  skipFrames)

Initializes a new instance of the T:System.Diagnostics.StackFrame class that corresponds to a frame above the current stack frame.

Parameters
skipFramesThe number of frames up the stack to skip.

Definition at line 63 of file StackFrame.cs.

◆ StackFrame() [4/6]

System.Diagnostics.StackFrame.StackFrame ( int  skipFrames,
bool  fNeedFileInfo 
)

Initializes a new instance of the T:System.Diagnostics.StackFrame class that corresponds to a frame above the current stack frame, optionally capturing source information.

Parameters
skipFramesThe number of frames up the stack to skip.
fNeedFileInfotrue to capture the file name, line number, and column number of the stack frame; otherwise, false.

Definition at line 73 of file StackFrame.cs.

◆ StackFrame() [5/6]

System.Diagnostics.StackFrame.StackFrame ( string  fileName,
int  lineNumber 
)

Initializes a new instance of the T:System.Diagnostics.StackFrame class that contains only the given file name and line number.

Parameters
fileNameThe file name.
lineNumberThe line number in the specified file.

Definition at line 87 of file StackFrame.cs.

◆ StackFrame() [6/6]

System.Diagnostics.StackFrame.StackFrame ( string  fileName,
int  lineNumber,
int  colNumber 
)

Initializes a new instance of the T:System.Diagnostics.StackFrame class that contains only the given file name, line number, and column number.

Parameters
fileNameThe file name.
lineNumberThe line number in the specified file.
colNumberThe column number in the specified file.

Definition at line 100 of file StackFrame.cs.

Member Function Documentation

◆ GetFileColumnNumber()

virtual int System.Diagnostics.StackFrame.GetFileColumnNumber ( )
virtual

Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.

Returns
The file column number, or 0 (zero) if the file column number cannot be determined.

Definition at line 193 of file StackFrame.cs.

◆ GetFileLineNumber()

virtual int System.Diagnostics.StackFrame.GetFileLineNumber ( )
virtual

Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.

Returns
The file line number, or 0 (zero) if the file line number cannot be determined.

Definition at line 186 of file StackFrame.cs.

◆ GetFileName()

virtual string System.Diagnostics.StackFrame.GetFileName ( )
virtual

Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable.

Returns
The file name, or null if the file name cannot be determined.

Definition at line 173 of file StackFrame.cs.

◆ GetILOffset()

virtual int System.Diagnostics.StackFrame.GetILOffset ( )
virtual

Gets the offset from the start of the Microsoft intermediate language (MSIL) code for the method that is executing. This offset might be an approximation depending on whether or not the just-in-time (JIT) compiler is generating debugging code. The generation of this debugging information is controlled by the T:System.Diagnostics.DebuggableAttribute.

Returns
The offset from the start of the MSIL code for the method that is executing.

Definition at line 165 of file StackFrame.cs.

◆ GetMethod()

virtual MethodBase System.Diagnostics.StackFrame.GetMethod ( )
virtual

Gets the method in which the frame is executing.

Returns
The method in which the frame is executing.

Definition at line 151 of file StackFrame.cs.

◆ GetNativeOffset()

virtual int System.Diagnostics.StackFrame.GetNativeOffset ( )
virtual

Gets the offset from the start of the native just-in-time (JIT)-compiled code for the method that is being executed. The generation of this debugging information is controlled by the T:System.Diagnostics.DebuggableAttribute class.

Returns
The offset from the start of the JIT-compiled code for the method that is being executed.

Definition at line 158 of file StackFrame.cs.

◆ ToString()

override string System.Diagnostics.StackFrame.ToString ( )

Builds a readable representation of the stack trace.

Returns
A readable representation of the stack trace.

Definition at line 201 of file StackFrame.cs.

Member Data Documentation

◆ OFFSET_UNKNOWN

const int System.Diagnostics.StackFrame.OFFSET_UNKNOWN = -1

Defines the value that is returned from the M:System.Diagnostics.StackFrame.GetNativeOffset or M:System.Diagnostics.StackFrame.GetILOffset method when the native or Microsoft intermediate language (MSIL) offset is unknown. This field is constant.

Definition at line 32 of file StackFrame.cs.


The documentation for this class was generated from the following file: