Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

PMString XCODE DEBUG - How i see the value in string?

Guest
Feb 04, 2009 Feb 04, 2009
I try to see the value from a PMString, but the debug only show me value in UTF16TextChar [16], when I change the value using View Value AS... I got a message in summary "OUT OF SCOPE".
Someone know how i can do that?

Thanks a loot!
TOPICS
SDK
4.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 04, 2009 Feb 04, 2009
I try to view variable expression like that ((*(UnicodeSavvyString*)(&resultString))).fSmallStorage, but show me a array os chars again :(
Someone can help me?
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2009 Feb 04, 2009
RBueno:

There is a file that can be edited on Windows boxes that allow the programmer to specify the format he/she wishes to view variable types in. It makes looking at a PMString, or for that matter a PMRect or other very specific InDesign types, a piece of cake. I am looking for it now, and if I can find it, I will share it with you (and the rest of the forum).

I believe that XCode has something similar, though I am not as familiar with XCode as I am with VS.

Alas, the file is one of those that I hardly ever touch so remembering the filename is turning out to be a chore. When I do, I will add further information to this entry. If anyone else viewing this forum can remember the file, please feel free to chime in.

John
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
Maybe this is what you're referring to.
autoexp.dat.

http://www.virtualdub.org/blog/pivot/entry.php?id=120

If not you're going to be writing a custom visualizer, it's something I've been thinking about doing for the last three years and not quite got around to!! So the obvious, lazy-man question is, "Has anyone else done one?"
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Feb 04, 2009 Feb 04, 2009
I don't have a good way of doing this in Xcode, so I usually just put in TRACE statements and view the value in Adobe's DebugWindow application. DebugWindow is in the SDK's devtools/bin folder. Just launch DebugWindow and when TRACE is hit, the output goes there.

TRACE("myPMStr = \"");
TRACE(myPMStr.GrabCString());
TRACE("\"\n");

That being said, I hope someone has a good solution for this. Using TRACE is not very fun.

Cheers!

-- Jim
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 04, 2009 Feb 04, 2009
T Schneider recommends to not use data formatters, just a few postings ago.
Thrill seekers have a look though at the CS3 porting guide, about page 126.
Reminds me I should also give them a try.

Dirk
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2009 Feb 05, 2009
In the debugger right-click to edit the data formatters. For a PMString use:

>size={$VAR.CharCount()} "{(char *)$VAR.GrabCString()}:s"

I posted a heads-up about data formatters. Myself, I usually have them turned on. But depending on where you set the breakpoint, it may cause you debugger to hang. It has to do with how Xcode calculates which variables have been initialized. I once found an older post on an Apple-mailing list explaining it (can't find it now). But I do hope Apple gets around to fixing soon.

If you experience the problem, there are two ways that may get you around it. 1) Initialize all you variables at the beginning of the method you want to break in, or 2) break just outside the function and single step into and all the way till you get where you want.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2009 Feb 05, 2009
Yeah, i ready porting guide too, but my friend develop in VS 2005 and for him when he debugging he can see the value in a variable PMString, that is very cool!
So i gonna use XCode for see the values too, maybe have some way too do that.

obs: Sorry for my bad English ;), I from Brazil.

Thanks a Loot!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 05, 2009 Feb 05, 2009
RBueno:<br /><br />M. Pearce was correct. The file to use in VS 2005 to autoformat watches is autoexp.dat and it can be found in the following folder in Windows (assuming standard installation, etc.):<br /><br />b C:\Program Files\Microsoft Visual Studio 8\Common7\Packages\Debugger\autoexp.dat<br /><br />As for the formatter string I use to specify how a PMString ought to be displayed, here it is:<br /><br />b PMString=savvy=<UnicodeSavvyString.fUTF16Buffer, su>, oldstyle=<fABuffer, s> <br /><br />Slip that in at the end of the autoexp.dat file and you will be able to see the values of your PMStrings in watches and quick watches.<br /><br />WRT your poor English, please do not give it another thought. We're communicating, and that's what matters.<br /><br />R,<br />John<br /><br />P.S. Don't know if it is intentional, but "loot" is the fruit of a thief's professional practice. Usually, the speaker uses the word "lot" instead of "loot" in the context of thanking someone profusely. Still, those of us who are eccentric may choose the more colorful phrase as you did, and there's nothing wrong with that. We can converse more privately, if you wish, about the vagaries of the English language (I am a pedant and love to talk about words, as you may have guessed). My private email address is john am darnell (at) gmail dot com.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 05, 2009 Feb 05, 2009
So i just need found where is the configuration file in XCode.
Maybe if I do the some in the file, i can see the value from a PMString.

PS: I found in Porting Guide one page say about Data formatters, so i found this one for PMString.

CharCount: %UnicodeSavvyString.fNumChars%,
platform buffer: {(char*)$VAR.fABuffer+1}:s

But he say the string only appear if platform buffer is filled out.
The number of characters CharCount: %UnicodeSavvyString.fNumChars% appear, but the string not :(
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 06, 2009 Feb 06, 2009
PMString has two ways of storing it's string internally. Short string (< 16 chars) are kept in the fABuffer. Long strings are kept inside the Unicode string, where memory is allocated dynamically. If you use the formatter in post #6, you will always get a result.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Feb 06, 2009 Feb 06, 2009
LATEST
Thanks i use size={$VAR.CharCount()} "{(char *)$VAR.GrabCString()}:s"
And now i can see the values, Schneider do you know where is your post about Data Formatters ?

Again Thanks!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines