Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / December 2003



Tip: Looking for answers? Try searching our database.

std::string & the debugger

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Alldritt - 15 Dec 2003 01:27 GMT
Hi,

I'm sorry if this has been asked and answered, but nothing came up with I
searched.

I've switched from CW8.3 to 9.1.  I am trying to look the content of my
std::string variables and its much harder to get at the actual string data.
Also, I have my own specialization of basic_string<unsigned short> which I
have been using for UTF-16 data.  The View As Unicode in CW8.3 allowed me to
see this, but in 9.1, its no longer working.

My code calls DataViewLibInit at app startup, but I don't see the data
viewer helping out much.

What do I have to do to (a) get the debugger to show the contents of an
std::string and (b) view UTF-16 data as we once could do?

I'm right on the verge of giving up on 9.1 and going back to 8.3 (except
that 8.3 crashes generating XSYM files for my project -- sigh).

Cheers
-Mark
MW Ron - 16 Dec 2003 15:32 GMT
Hi Mark,

>I've switched from CW8.3 to 9.1.  I am trying to look the content of my
>std::string variables and its much harder to get at the actual string data.
[quoted text clipped - 7 lines]
>What do I have to do to (a) get the debugger to show the contents of an
>std::string and (b) view UTF-16 data as we once could do?

Displaying std::string works fine for me but it doesn't work
that well for std::basic_string<any other type besides char>.

send me an e-mail on this so I can forward it on.  Some of the engineers
are off this week, almost everyone will be off the 23rd to the 2nd.   So
if you send it to me I can try to catch the right person while they are
working.

>I'm right on the verge of giving up on 9.1 and going back to 8.3 (except
>that 8.3 crashes generating XSYM files for my project -- sigh).

include your system information and all.   9.1 seems to be pretty good
and the annoyances a minimum,  it is a keeper, lets just get this fixed.
:)

Ron

Signature

                  Metrowerks wishes you and yours
              Seasons Greetings and Happy Holidays

 Get Geekware and Software  http://store.metrowerks.com
  Shop our online store and get free shipping until Dec 31

Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

Robert Smith - 17 Dec 2003 15:31 GMT
> >I've switched from CW8.3 to 9.1.  I am trying to look the content of my
> >std::string variables and its much harder to get at the actual string data.
[quoted text clipped - 10 lines]
>
> Ron

std::string doesn't always display for me in the debugger. A string
defined in a function will display okay, but once I pass it to a
function (by value or by reference) the debugger just shows the hex
address value. If I toggle the triangles next to the string variable
in the debugger's variables panel I get something like:

s : std::basic_string<char, .... >
 r_:
   first_:
     r:
       t0:
         words_:
       t1:
         f_:
         cap_:
         size_:
         data_: char *  !! HERE is the string data !!
       t2:

> include your system information and all.   9.1 seems to be pretty good
> and the annoyances a minimum,

This is OSX 10.2.8 with CW 9.1 IDE 5.5 Build 1292.

>  it is a keeper, lets just get this fixed.
Here, here!

Robert
Howard Hinnant - 17 Dec 2003 15:40 GMT
> s : std::basic_string<char, .... >
>   r_:
[quoted text clipped - 8 lines]
>           data_: char *  !! HERE is the string data !!
>         t2:

Be forwarned that if the size of the string is "short" (10 or under)
then you'll need to look under t2 for the value.

-Howard
Lally Singh - 21 Dec 2003 07:56 GMT
rsmith@ncbi.nlm.nih.gov (Robert Smith) wrote in message news:
> std::string doesn't always display for me in the debugger. A string
> defined in a function will display okay, but once I pass it to a
[quoted text clipped - 14 lines]
>           data_: char *  !! HERE is the string data !!
>         t2:

So, how about the entry in "MSL Formats.xml" under
Plugins:Support:VariableFormats?

It's got an entry that's supposed to show this stuff, but it doesn't
seem to work for me on
std::basic_string<unsigned short> (unicode strings).

I still haven't figured out the full syntax for the xml files (what
are the possible values for <osname>, <typenamematch>, and
<runtimename> tags?).  The paragraph in the IDE user's guide doesn't
tell too much.
Mark Alldritt - 22 Dec 2003 21:24 GMT
>> s : std::basic_string<char, .... >
>>   r_:
[quoted text clipped - 20 lines]
> <runtimename> tags?).  The paragraph in the IDE user's guide doesn't
> tell too much.

To add to this, I'm finding that I cannot look at Cocoa/Objetive-C's
NSString in the debugger at all.  When I expand the NSString* pointer I see
an isa entry, and nothing else.  Makes debugging rather difficult.

Cheers
-Mark
Lally Singh - 25 Dec 2003 03:01 GMT
lally_spam_box@yahoo.com (Lally Singh) wrote in message news:
> It's got an entry that's supposed to show this stuff, but it doesn't
> seem to work for me on
[quoted text clipped - 4 lines]
> <runtimename> tags?).  The paragraph in the IDE user's guide doesn't
> tell too much.
Ok, found the release notes that cover this stuff better.  Now it's on
to figure out how to get a unicode string to show up correctly...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.