How to watch runtime globals when running game from editor?

To debug a problem, I need to setup a watch for a global variable. (GUObjectArray.)

If I run DebugGame or Development, GUObjectArray is accessible to the watch window. (By calling GUObjectArray.IndexToObject()). However, I don’t have debug symbols for the game runtimes, which means I can’t put in breakpoints where I need them to make use of the watch.

On the other hand, if I use DebugGame Editor, which does let me use breakpoints, the watch window can’t find GUObjectArray. (Identifier “GUObjectArray is undefined.”) I assume that despite being global, it’s being put… somewhere? When the game runs in the editor. The breakpoints from the game window still work, so I assume I don’t have to attach to an entirely different process.

Does anyone know how I can get access to this global game variable when running an editor configuration? (Trying to avoid having to build the entire engine from source.)

To watch for a global variable I’m going to reference this Tutorial:

Specifically this part:

Visual Studio – Watch Globals

See globals in the Watch list using ModuleName!VariableName syntax.

The format {,,ModuleName}::VariableName also works, and Rider only supports that format.

Some examples:

  • UnrealEditor-Core!GConfig
  • UnrealEditor-Engine!GPlayInEditorContextString
  • UnrealEditor-Core!GFrameCounter

Skip the ModuleName! part in monolithic (AKA packaged) builds.

The difference you’re having between editor builds and packaged builds is that while packaged builds can watch a variable directly in the global space, just VariableName, the Editor builds have code in modules (separate DLLs) which each contain their own global variables. So you need to figure out which module the variable is in and then put that format in the watch window, like this: {,,ModuleName}::VariableName, as per the quote above.