Navigation
API > API/Runtime > API/Runtime/Core
Global visualizer state manager that handles the complexities of natvis lookup rules for DLLs and LiveCoding
The singleton instance of this class is forward declared in CoreGlobals.h (GCoreDebuggingState), with additional symbols added to each DLL through UE_VISUALIZERS_HELPERS (GDebuggingState).
When a plugin or engine system needs to provide a globally accessible pointer to a natvis visualizer, that pointer can be added by calling FVisualizerDebuggingState::Assign using a globally unique ID that is used to find the pointer in the natvis. GUIDs may be generated using any readily-available GUID generator tool.
Pointers are located using an intrinsic call to strstr that finds the pointer's offset using a string match of the original GUID's lower-case, 32-character string representation of the form "c198d347ec1243ec833c423bd5fb6084". The offset of the address of the match divided by 32 gives the entry index from which the actual debug ptr can be retrieved.
An example visualizer syntax is included below. It is recommended that most natvis files utilizing this method would include an global intrinsic function at the top for quick access:
// C++: struct FMyGlobalState { static FMyGlobalState* GetSingleton(); TArray
// Register the global state FGuid DebugVisualizerID(0x1bdc1747, 0x6b924697, 0xbd8fccc8, 0xb26b4f79) EVisualizerDebuggingStateResult Result = FVisualizerDebuggingState::Assign(DebugVisualizerID, FMyGlobalState::GetSingleton());
// .natvis:
| Name | FVisualizerDebuggingState |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Modules/VisualizerDebuggingState.h |
| Include Path | #include "Modules/VisualizerDebuggingState.h" |
Syntax
struct FVisualizerDebuggingState
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Modules/VisualizerDebuggingState.h | |||
| Modules/VisualizerDebuggingState.h | |||
| Modules/VisualizerDebuggingState.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~FVisualizerDebuggingState() |
Modules/VisualizerDebuggingState.h |
Functions
Public
Protected
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
EVisualizerDebuggingStateResult AssignImpl
(
const FGuid& UniqueId, |
Implementation function for Assign | Modules/VisualizerDebuggingState.h | |
void * Find
(
const FGuid& UniqueId |
Attempt to locate the index of the specified unique ID | Modules/VisualizerDebuggingState.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static EVisualizerDebuggingStateResult Assign
(
const FGuid& UniqueId, |
Assign a globally accessible debugging state ptr by name, potentially overwriting a previously assigned ptr | Modules/VisualizerDebuggingState.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
void operator=
(
const FVisualizerDebuggingState& |
Modules/VisualizerDebuggingState.h | ||
void operator=
(
FVisualizerDebuggingState&& |
Modules/VisualizerDebuggingState.h |