UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Core::FVisualizerDebuggingState Struct Reference

#include <VisualizerDebuggingState.h>

Public Member Functions

 FVisualizerDebuggingState ()
 
 FVisualizerDebuggingState (const FVisualizerDebuggingState &)=delete
 
void operator= (const FVisualizerDebuggingState &)=delete
 
 FVisualizerDebuggingState (FVisualizerDebuggingState &&)=delete
 
void operator= (FVisualizerDebuggingState &&)=delete
 
 ~FVisualizerDebuggingState ()
 

Static Public Member Functions

static CORE_API EVisualizerDebuggingStateResult Assign (const FGuid &UniqueId, void *DebugPtr)
 

Protected Member Functions

EVisualizerDebuggingStateResult AssignImpl (const FGuid &UniqueId, void *DebugPtr)
 
voidFind (const FGuid &UniqueId) const
 

Protected Attributes

const charGuidString = nullptr
 
void ** Ptrs = nullptr
 
FVisualizerDebuggingStateImplPimplData = nullptr
 

Detailed Description

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:

<Intrinsic Name="GetDebugState" Expression="GDebuggingState->Ptrs[(strstr(GDebuggingState->GuidString, GuidString) - GDebuggingState->GuidString)/32]"> <Parameter Name="GuidString" Type="char*"> </Intrinsic>

// C++: struct FMyGlobalState { static FMyGlobalState* GetSingleton(); TArray<FString> TypeNames; }; struct FMyStruct { int32 TypeNameIndex; };

// Register the global state FGuid DebugVisualizerID(0x1bdc1747, 0x6b924697, 0xbd8fccc8, 0xb26b4f79) EVisualizerDebuggingStateResult Result = FVisualizerDebuggingState::Assign(DebugVisualizerID, FMyGlobalState::GetSingleton());

// .natvis:

<Type Name="FMyStruct">

<Intrinsic Name="GetGlobalState" Expression="((FMyGlobalState*)GetDebugState(&quot;1bdc17476b924697bd8fccc8b26b4f79&quot;))""></Intrinsic>

<DisplayString>Type={ GetGlobalState()->TypeNames[TypeNameIndex] }</DisplayString> </Type>

Constructor & Destructor Documentation

◆ FVisualizerDebuggingState() [1/3]

UE::Core::FVisualizerDebuggingState::FVisualizerDebuggingState ( )

◆ FVisualizerDebuggingState() [2/3]

UE::Core::FVisualizerDebuggingState::FVisualizerDebuggingState ( const FVisualizerDebuggingState )
delete

◆ FVisualizerDebuggingState() [3/3]

UE::Core::FVisualizerDebuggingState::FVisualizerDebuggingState ( FVisualizerDebuggingState &&  )
delete

◆ ~FVisualizerDebuggingState()

UE::Core::FVisualizerDebuggingState::~FVisualizerDebuggingState ( )

Member Function Documentation

◆ Assign()

static CORE_API EVisualizerDebuggingStateResult UE::Core::FVisualizerDebuggingState::Assign ( const FGuid UniqueId,
void DebugPtr 
)
static

Assign a globally accessible debugging state ptr by name, potentially overwriting a previously assigned ptr

Parameters
UniqueIdA guid that uniquely identifies this debug ptr. This should be the same as is used to access the ptr inside a natvis file.
DebugPtrThe pointer that needs to be accessible from natvis
Returns
EVisualizerDebuggingStateResult::Success if the operation completed successfully, otherwise an error code

◆ AssignImpl()

EVisualizerDebuggingStateResult UE::Core::FVisualizerDebuggingState::AssignImpl ( const FGuid UniqueId,
void DebugPtr 
)
protected

Implementation function for Assign

◆ Find()

void * UE::Core::FVisualizerDebuggingState::Find ( const FGuid UniqueId) const
protected

Attempt to locate the index of the specified unique ID

◆ operator=() [1/2]

void UE::Core::FVisualizerDebuggingState::operator= ( const FVisualizerDebuggingState )
delete

◆ operator=() [2/2]

void UE::Core::FVisualizerDebuggingState::operator= ( FVisualizerDebuggingState &&  )
delete

Member Data Documentation

◆ GuidString

const char* UE::Core::FVisualizerDebuggingState::GuidString = nullptr
protected

Single string containing all GUID strings ordered by their insertion order. The single string is designed to support finding a string offset using a single strstr instrinsic call, and dividing the result by 32. This string exists for easy referencing inside natvis files; it points to PimplData->OrderedGuidString. Example layout:

OrderedGuidString: "d9ad42709d2c4bc8a2f8f925e1617b288456cfc3222f4833a8afa45a6ed73b5a9873a9fedd8441d49ef6b3258e8a6c60#" Ptrs: [Ptr1 ,Ptr2 ,Ptr3]

◆ PimplData

FVisualizerDebuggingStateImpl* UE::Core::FVisualizerDebuggingState::PimplData = nullptr
protected

Pimpl to avoid pulling in too many headers since this header is included everywhere

◆ Ptrs

void** UE::Core::FVisualizerDebuggingState::Ptrs = nullptr
protected

Array of void* ptrs to the user-provided debugging state ptrs for each entry. Points directly to PimplData->DebugPtrs.GetData() for quick referencing inside natvis without needing any other symbols or casting.


The documentation for this struct was generated from the following files: