Ben Combee a �crit :

> At 11:11 AM 12/5/2003, Luc Le Blanc wrote:
> >When I compile my program with full CW 8.3 optimizations, it crashes
> >when trying to lock a DB record it obtained with a wrong index. This
> >does not occur without optimizations. I tried tracking the problem with
> >the debugger, but nothing makes sense: variables reported in the monitor
> >window barely resemble what they should be, even after going over a line
> >such as index = 0. The CW settings dialogs warns that debugging with
> >optimizations on is going to be harder. What is the best strategy, then?
>
> 1) Learn assembly language and debug in mixed mode.
>
> 2) Ship with optimizations turned off.

That's what I did.


> 3) Look at possible root causes.

Like? So far, they best I could find is to print out the code and follow it
carefully.


> The most common problem with optimized code is assumptions about
> variables.  Variables may be allocated to registers now rather than the
> stack.

Whose assumptions? The compiler's or mine? I personnaly don't care where
they're keypt. But can the CW debugger display the contents of variables if
they get stored in registers? Would this be the reason of nonsense variables
contents in the monitor window?


>  Writing past the end of an array may be harmless in debug mode but
> deadly in release mode.

What do you call debug mode? Running under debugger control, running with a
debug ROM under POSE, or compiling without optimizations?


--
Luc Le Blanc


--
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to