Re: Displaying string variables in debugger...
Re: Displaying string variables in debugger...
- Subject: Re: Displaying string variables in debugger...
- From: Kevin Hoyt <email@hidden>
- Date: Thu, 19 Aug 2004 08:46:57 -0700
Great! That does let me see the strings...
And, just for posterity, this format string needs to be added with the
'edit summary format' menu item or by double clicking on the Summary
column.
Thank you for the help :-)
However, now I have even more questions...
Why do I have to do this in the first place? Character strings really
seem like a basic data type that Xcode should be able to display be
default. Is Xcode's behavior by design, is there something funky with my
installation, or is this a bug?
A search of Xcode help comes up with one page that describes 'summary
format.' What does it mean when it says "you can not specify a custom
format for string types, such as NSString, char*, and so on." Isn't that
what I just HAD to do because they are not displayed by default???
Anyway...
The formatter only worked for the one variable I set it for. I have
several others of the same type that are not using the custom formatter.
Based on what I found in DataFormatterPlugin.h, I thought it would be
applied to all variables of the same type.
More searching shows where the problem may be...
Let's say that I have three local buffers declared as:
char buf1[128];
char buf2[256];
char buf3[256];
And I create a formatter for the first one as {(char *)$VAR}:s
buf1 will now show as a string in the Summary column.
buf2 does NOT :-(
Taking a peak at ~/Library/Application Support/Apple/Developer
Tools/CustomDataViews/CustomDataViews.plist shows the following formatter
has been created:
Dictionary: char[128]
SummaryString: {(char *)$VAR}:s
So this means the formatter is ONLY applied to char strings in 128
buffers... the 256 ones do not match!
Sure enough, if I add a second formatter for char[256], buf2 and buf3 show
the Summary.
Is it possible to make a formatter that will apply to all character
buffers regardless of their size?
Also, what about more examples?
For instance, what would a formatter look like for wchar_t strings?
Or showing multiple strings from inside a structure like this:
typedef struct myBuffs
{
char buf1[128];
char buf2[256];
char buf3[512];
} myBuffs_t;
email@hidden wrote on 08/19/2004 01:07:59 AM:
> How about this data formatter:
>
> {(char *)$VAR}:s
>
> -chris
>
> On Aug 17, 2004, at 11:03 AM, Kevin Hoyt wrote:
>
> >
> > For example if I have
> > char myString[]="myString";
> >
> > I can not get myString to show in the debugger.
> >
> > Any suggestions?
_______________________________________________
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.