TSubobjectPtr won't visualize properties properly in Visual Studio debugger Watch?

Hi all,

So pointers that are declared as TSubobjectPtr<> are not visualizing properly for me within Visual Studio 2013 debugger ‘Watch’ variables. They appear as fully expandable objects, where I can expand them all through their class hierarchy and see the properties at each class level. But I can’t directly retrieve any properties on demand using “Pointer->Property” syntax – if I try that, the Watch expression evaluator simply says “expression must have pointer type” (and manually casting the type doesn’t help). (nor does it work to hover tool watch values on properties of TSubobjectPtr’s in the code)

I’ve installed the UE4 VS 2013 debugger visualizers, and I see FNames just fine so I know that’s working. I even see a section in the visualizer file about these kinds of pointers:

<DisplayString>{Object}</DisplayString>

But it just doesn’t seem to work for me, or other people whom I’m developing with :frowning:

Has anyone had this work for them, or have any ideas how to fix it?

Thanks for your help!

Blech, it ate my code snippet, here we are:

<!-- FSubobjectPtr|TSubobjectPtr visualizer -->
  <Type Name="FSubobjectPtr|TSubobjectPtr&lt;*&gt;">
    <DisplayString>{Object}</DisplayString>
  </Type>

Hi,

Your visualiser should work, but only let you view the TSubobjectPtr instance as if it was a pointer. It doesn’t enable the debugger to allow support Pointer->Property syntax; for that you’ll still have to do Pointer.Object->Property.

TSubobjectPtr will soon be deprecated in favour of raw pointers anyway, so I wouldn’t worry too much about it.

Steve

Aha yes indeed, using this expression syntax I can properly “watch” any variable of the pointer in the debugger window:

((USkeletalMeshComponent*)Mesh1P.Object)->bReceivesDecals

But yeah, it prevents watch tooltips from working because it doesn’t inherently know how to evaluate that type. So will look forward to TSubobjectPtr’s becoming extinct :slight_smile:

Thank you!