> -----Original Message-----
  > Subject: Re: Breakpoint stopping code, But I removed it!
  > 
  > At 06:44 PM 8/3/2003, Randall Pulsifer wrote:
  > >Anyone have any tips on how to remove a breakpoint that just won't
  > quit?
<snip>
  > >
  > >Only odd thing - it doesn't stop with the solid blue arrow, but
with
  > the
  > >dotted blue arrow, that might indicate waiting for user input if
you
  > >were single stepping.
  > >
  > >Any Ideas???
  > 
  > Did you save the simulator state and restore it while your program
was
  > loaded?  It sounds like the program is loaded at a different
location in
  > memory than the debugger expects, so its not seeing a breakpoint
there,
  > but
  > the instructions are still modified in memory to set the breakpoint.
  > 
  > Try deleting the pSYM file for your project, and also start from a
  > totally
  > clean simulator session.
  > 
I fixed the problem - it's not the IDE, it was just coincidence that the
line that I had the breakpoint on (the diffC =...) did not cause an
error when you stopped on it, then continued, but failed miserably when
run at "full speed". The difference lies in the treatment of pointers.
As far as I knew this should work (tho I can't recall ever doing it
quite this way before):
                Int16  * NumberTimes1Ptr, * NumberTimes2ptr     
                NumberTimes1Ptr = (Int16 *) ((UInt32)rec1 + FishStr1Len
+ 1);
                NumberTimes2Ptr = (Int16 *) ((UInt32)rec2 + FishStr2Len
+ 1);
                diffC = *NumberTimes1Ptr - *NumberTimes2Ptr;

It doesn't, at least not with CW9. The following code DOES work:
                Int16   NumberTimes1, NumberTimes2
                NumberTimes1Ptr = (UInt8 *) ((UInt32)rec1 + FishStr1Len
+ 1);
                NumberTimes2Ptr = (UInt8 *) ((UInt32)rec2 + FishStr2Len
+ 1);
                MemMove(&NumberTimes1,NumberTimes1Ptr,2);
                MemMove(&NumberTimes2,NumberTimes2Ptr,2);
                diffC = NumberTimes1 - NumberTimes2;

Would anyone like to venture a guess as to what the difference is? BTW,
recx is a packed database record which starts with a string (hence the
+1 to get by the null char) followed by a Int16 which is what I'm trying
to subtract. So, in the first instance, even though no variables are
ever declared, the calculated pointers do indeed point into a allocated
and locked record. Or so I thought. As I look at it, I bet that, in the
first instance:
                NumberTimes1 = *NumberTimes1Ptr;
                NumberTimes1 = *NumberTimes1Ptr;
                diffC = NumberTimes1 - NumberTimes2;
WOULD work. What do you think?


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

Reply via email to