-----Original Message-----
From: Jun-Kiat Lam [SMTP:[EMAIL PROTECTED]]
Yes, I have seen this to. Thank you for an answer on this.
Rob Cohen
[EMAIL PROTECTED]
Sent: Wednesday, July 19, 2000 1:13 PM
To: Palm Developer Forum
Subject: RE: *REALLY* strange codewarrior debugger issue. confirmation any
one?
BTW, this would be one of the reasons why you should turn off optimizations
for debugging builds. Optimizations tend to rearrange code, perform register
coloring, and lots of other funky stuff that can make odd things show up in
the debugger that would not otherwise be there.
Rgds,
Jun-Kiat Lam
Metrowerks Technical Support
Sent: Wednesday, July 19, 2000 8:53 AM
To: Palm Developer Forum
Subject: RE: *REALLY* strange codewarrior debugger issue. confirmation
any one?
> ok.
> i've created a new OS3.5 stationary project, C++ App.
>
> this is my PilotMain:
>
> UInt32 PilotMain( UInt16 cmd, MemPtr cmdPBP, UInt16 launchFlags)
> {
>
> UInt32 a;
> UInt32 b;
>
> a=10;
> b=20;
>
> return StarterPalmMain(cmd, cmdPBP, launchFlags);
> }
>
> the only modifications to the project are the 4 lines with the a and b
> variables.
>
> when single stepping through the code, the assignment 'a=10'
> also sets b to
> 10, and the next assignment 'b=20' also sets a to 20 (after
> each assignment,
> the a AND b variable are in red in the var window, and with
> same value)..
It's called register coloring -- the compiler sees that in your code a and b
are never used in the same line, so it uses the same register to hold both
variables. Set your optimizations to level 0, and you will see the expected
information in the debugger pane.
-hkmlt
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/