Debugging an OwnedArray


#1

Hi

I am trying to understand how I can see elements hold in an OwnedArray.

I explain:

when digging into let's say, member OwnedArray<AudioPluginFormat> formats (in class AudioPluginFormatManager), I can see that member numUsed = 3. There are 3 elements into the array and I need to see what they are.

So I expand the object into VS Watch section, I can see member data, then elements, then data again, etc etc etc, and I never get to the elements themselves. (see attached picture)

I surely miss something, thanks for your kind help.

 

Nathaniel


#2
will show the arrays contents but is in most cases useless as one often wants to have a look at some members of the element. The following will work in this case but is a bit more cumbersome as you can't easily search through the array:
[code]
ownedArray.data.elements.data[0]->member
ownedArray.data.elements.data[1]->member
[/code]

As a related question: Is it possible to look into Arrays, HeapBlocks and so on in XCode without having to decrypt the memory view?

will show the arrays contents but is in most cases useless as one often wants to have a look at some members of the element. The following will work in this case but is a bit more cumbersome as you can’t easily search through the array:

ownedArray.data.elements.data[0]->member
ownedArray.data.elements.data[1]->member

As a related question: Is it possible to look into Arrays, HeapBlocks and so on in XCode without having to decrypt the memory view?


#3

You can, for example, use the "Add Expression..." feature of the Xcode debugger, which is quite useful for stuff like that.


#4

I have a clear preference on working with VS...

Thanks

Nathaniel


#5

You could create your own debugger extension for VS using autoexp.dat -> https://blogs.msdn.microsoft.com/vcblog/2012/07/12/debugger-type-visualizers-for-c-in-visual-studio-2012/

 

Maybe this is something that could be added to JUCE package?