Debugging an OwnedArray

Wow, that looks nice!

I’m using JUCE v7.0.12, from this May I believe.

Yes!! I finally got it to work! :clinking_glasses:
I was suspicious of the warnings I was getting from Microsoft’s own natvis files, and perhaps others I had unknowingly collected over the years. So I uninstalled the whole thing then re-installed ‘Microsoft Visual Studio Community 2022 (64-bit)’

And then it worked, I don’t know any details because I wiped the whole thing.

1 Like

Great news! It’s also super useful for looking at value trees🤓

Just anecdotal, but to me it seems like Microsoft stuff tends to add things and never clean up the old things, even if it would be better to do so.

Yeah, my copy has gone through so many patch updates. At least I know now that any new visualisers should go in the documents folder, and not in the install folder.
Edit
Just added OwnedArray to my
…\Documents\Visual Studio 2022\juce.natvis file:

It seems to work OK, even though I have no idea what I’m doing! :grin::roll_eyes:

<Type Name="juce::OwnedArray&lt;*&gt;">
	<DisplayString Condition="values.numUsed == 0">{{ EMPTY numAllocated={values.numAllocated} }}</DisplayString>
	<DisplayString>{{ numUsed={values.numUsed} numAllocated={values.numAllocated} }}</DisplayString>
	<Expand>
		<Item Name="[numUsed]">values.numUsed</Item>
		<ArrayItems>
			<Size>values.numUsed</Size>
			<ValuePointer>values.elements.data</ValuePointer>
		</ArrayItems>
	</Expand>
</Type>