At 04:11 PM 9/3/2002 -0400, you wrote:
>Hi.  I've noticed some very strange behavior in POSE when I set breakpoints.
>My code sets a bunch of globals that correspond to Unique IDs of List items
>in its first form.  In the debug ROM V 3.5, my code will crash about 90% of
>the time in the first 100 events when it reads one of these globals as 0 and
>I get a "Wrote to Low Memory Error".  I can see this when I hit the debug
>button when it crashes.  However, when I set a breakpoint to where this
>global should be set, it *does* get set and the program runs without error.
>I tried this with a 4.1 ROM and there were no errors, but it happens on some
>other earlier ROMs as well. Does anybody know what's going on here and 1) if
>I should worry about it and 2) how I can get it to stop if its a bug in
>Codewarrior?  I'm running CW Version 4.2.6.832. Thanks a lot for any help.

Breakpoints do alter program execution -- when you set a BP, the debugger 
replaces the instruction that was originally there with a trap that 
activates the debugger.  Continuing from the breakpoint requires the 
debugger to put BP traps on all the instructions that would follow the 
current instruction, execute the instruction, reinsert the original 
breakpoint, and clear the temporary ones used to start the continue.

Setting a breakpoint shouldn't affect any other parts of your program 
execution.  Doing a debug build versus a release build could change 
behavior if something was relying on undefined behavior, but the code that 
gets DLed to the device when you start a debug session shouldn't be 
different except for the inserted BP instructions.

-- 
Ben Combee <[EMAIL PROTECTED]>
CodeWarrior for Palm OS technical lead
Palm OS programming help @ www.palmoswerks.com


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

Reply via email to