CW10.2 - View strings as strings in debugger

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CW10.2 - View strings as strings in debugger

1,811 Views
FridgeFreezer
Senior Contributor I

I'm probably missing something in one of the menus here, but CW7.2 would show you strings in the debug window as readable text strings, but CW10.2 will only let you display a vertical array of chars (by default shown by hex value). What have I missed?

Labels (1)
0 Kudos
9 Replies

935 Views
BlackNight
NXP Employee
NXP Employee

Hello,

its this about normal C strings (character pointers)?

Have a look at Eclipse Debugging with Strings for ways how to view strings in Eclipse/CodeWarrior MCU10.

 

Hope this helps,

BK

0 Kudos

935 Views
FridgeFreezer
Senior Contributor I

That's a good article, but my copy of CodeWarrior (10.2 / Build Id:120126) doesn't seem to have that ability, here is what I see when I click on the variable name:

 

0 Kudos

935 Views
BlackNight
NXP Employee
NXP Employee

can you share the declaration of your str variable?

 

BK

0 Kudos

935 Views
FridgeFreezer
Senior Contributor I

String variable is defined as:

char str[50];

 

 

 

0 Kudos

935 Views
BlackNight
NXP Employee
NXP Employee

hmm, I tried it now with ColdFire, and see your problem now:

If I have

char buf[] = "abcd";char *p = &buf[0];unsigned char ubuf[]="ABCD";unsigned char *up = &ubuf[0];signed char sbuf[]="1234";signed char *sp = &sbuf[0];

 then only 'p' and 'up' shows the string. Interesting. I'll need to dig into this.

 

BK

0 Kudos

935 Views
FridgeFreezer
Senior Contributor I

Thanks - glad it's not just me doing something wrong (which most things are!)

0 Kudos

934 Views
BlackNight
NXP Employee
NXP Employee

Yeah, happens to me all the time too :smileyhappy:.

What I have found out is that it works for 'unsigned char*', but not for signed char pointers. And not for arrays (independent if they are signed or not). I think this is an Eclipse problem, and I have filed a ticket on this subject.

 

There is good and bad news: I used Eclipse 3.7, and there you can at least cast in the Variable view the signed char* to an unsigned one: and it will show the string :smileyhappy:. The bad news: this does not work in Eclipse 3.6 for me (which is used in CodeWarrior for MCU10.2).

 

I guess I have to write a follow-up article then, and pushing for showing unsigned chars as strings, plus getting the casting working in Eclipse properly too :smileyhappy:.

 

Thanks for reporting that problem: that way things get fixed and improved....

 

BK

0 Kudos

935 Views
FridgeFreezer
Senior Contributor I

Great, thanks for following this up - I guess that means I've found two real bugs in CW10 now as well as in the silicon, I kinda feel like I should win a badge or something :smileylol:

 

Is there a way for us to track the status of the Eclipse bug?

0 Kudos

934 Views
FridgeFreezer
Senior Contributor I

So, any way to find out if this is picked up / progressed / fixed / ignored / buried in soft peat?

0 Kudos