ICorDebugType::GetStaticFieldValue Method
Gets an interface pointer to an ICorDebugValue object that contains the value of the static field referenced by the specified field token in the specified stack frame.
Syntax
HRESULT GetStaticFieldValue (
[in] mdFieldDef fieldDef,
[in] ICorDebugFrame *pFrame,
[out] ICorDebugValue **ppValue
);
Parameters
fieldDef
[in] An mdFieldDef
token that specifies the static field.
pFrame
[in] A pointer to an ICorDebugFrame that represents the stack frame.
ppValue
[out] A pointer to the address of an ICorDebugValue
that contains the value of the static field.
Remarks
The GetStaticFieldValue
method may be used only if the type is ELEMENT_TYPE_CLASS or ELEMENT_TYPE_VALUETYPE, as indicated by the ICorDebugType::GetType method.
For non-generic types, the operation performed by GetStaticFieldValue
is identical to calling ICorDebugClass::GetStaticFieldValue on the ICorDebugClass object that is returned by ICorDebugType::GetClass.
For generic types, a static field value will be relative to a particular instantiation. Also, if the static field could possibly be relative to a thread, a context, or an application domain, then the stack frame will help the debugger determine the proper value.
GetStaticFieldValue
can be used only when a call to ICorDebugType::GetType
returns a value of ELEMENT_TYPE_CLASS or ELEMENT_TYPE_VALUETYPE.
Requirements
Platforms: See System Requirements.
Header: CorDebug.idl, CorDebug.h
Library: CorGuids.lib
.NET Framework Versions: Available since 2.0
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for