How to show JUCE strings in XCode's debugger:

If you need to preserve special characters like 'ß' so you can track down where they're being mangled using toCFString() is a better way to go.  

Another alternative would be:

{(NSString*) $VAR.toCFString()}:s

We pass strings by reference a lot in our Xcode project. It would be really helpful to be able to edit the summary of this type as well to see the String in UTF8. Could you offer some assistance?

Is there a current solution for this (one that works with xcode 5)? I'm getting really tired of debugging without being able to view strings!

 

XCode 5 doesn't even have debug -> Variables View menu

I use xcode 5 and this solution seems to work in most cases, though it's true that sometimes it doesn't seem to recognise the variable's type correctly.

How are people viewing strings now? The latest XCode seems to have proken everything for me.

I used to go: 

p str.toCFString()

But now I get:

error: Couldn't materialize struct: size of variable value (4) disagrees with the ValueObject's size (0)

Errored out in Execute, couldn't PrepareToExecuteJITExpression

Any ideas?

New Solution: Install the python script from here: http://www.github.com/jcredland/juce-toys/ which will decode Strings, Arrays,vars and all sorts.

The old solution was:

command regex jstring 's/(.+)/print Logger::outputDebugString(%1)/'

Then type: 

$jstring someobject.something

And out pops your string. 

2 Likes

Some awesome stuff there, Jim!

Genius!!