Turn off register variables for debugging

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

Turn off register variables for debugging

2,518 Views
sellynny
Contributor I
How can I turn off register variables for debugging?
Labels (1)
0 Kudos
6 Replies

640 Views
jag
Contributor IV

put the "volatile" keyword before the variables you want to see in the debugger.

 

Bye Jack 

0 Kudos

640 Views
J2MEJediMaster
Specialist I

I am not sure what you mean here. Are you talking about the debugger display, or how the compiler generates code? And what hardware target and Codewarrior version are you using?

 

---Tom

 

0 Kudos

640 Views
sellynny
Contributor I

My problem is that I have the same code running on Visual studio and it's fine. The same code running on CW doesn't have the good result. I tryed to debug step by step to compare but on CW I can't see some variables. In the debug window I have the wrong address for some variables (two different variables have the same address and nothing inside).

0 Kudos

640 Views
J2MEJediMaster
Specialist I

It sounds like you need to turn off all of the compiler optimizations in CodeWarrior. The optimizer will make statements and variables move about or disappear.

 

---Tom

0 Kudos

640 Views
sellynny
Contributor I
I already did it but nothing change.
0 Kudos

640 Views
CompilerGuru
NXP Employee
NXP Employee

Please provide more details, for example which architecture you are using.

 

I want to avoid to give a tip for a coldfire compiler switch when in the end you are using a S08

(or something else).

 

Daniel

 

See:

 

http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&message.id=3819

0 Kudos