Re: Debugging strings in XCode
Re: Debugging strings in XCode
- Subject: Re: Debugging strings in XCode
- From: Mike Lazear <email@hidden>
- Date: Fri, 14 Nov 2003 16:30:17 -0800
Jim,
That's a good explanation for why it does what it does. I can see
where you would want to see it as a array.
By entering (char *) myCharArray in the expressions window I was able
to see what I wanted. It still would be nice to be able to enter an
expression to do this in the variable window so that I didn't have to
add an expression for every string. I've got to believe that a high
percentage of char arrays are thought of as strings and not just as an
array of individual chars. I mentioned in one of my other posts that
when I create an expression {(char *) ($VAR)} what I get is the
address, something like 0xbffff790.
Thanks for the suggestion. Now, I just need to figure out how to file
a bug report.
Mike
(Thanks to all who posted to my "Debugging strings in XCode" subject,
that along the way I accidentally renamed with no subject)
To be fair, what you are actually asking is that Xcode present an array
of characters as a character string. If you have a (char *) variable,
then Xcode will show you the value as a string in the summary field.
We can't just show a character array as a string however, 'cause
somebody will legitimately want to see the array of characters as an
array of characters (particularly if they care what element 15 is or
they want to see past the first null.)
Still it seems reasonable that the summary view of a char array be the
array pointer cast as a char *. If you file a bug on this, I bet one
of the GUI debugger folks will add it, it would be pretty simple to do.
If you don't want to muck with the custom formatters, you can just use
the expressions window, and enter "(char *) myCharArray".
Jim
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.