Howdy.
Using CWR6.
I'm debugging an application that passes 1 million Gremlins on the
3.3 debug ROM. Under the 3.5 debug ROM (dr4), tapping any
poptrigger in any form generates the following error message from
POSE (3.0a):
"Test01" has just read from an unallocated chunk of memory.
I've been using the Palm Debugger under Windows to try to sort this
out. When POSE falls over, I get the following message in the
debugging window:
EXCEPTION ID = $80
'StrLen'
+$002E 10C167B2 *TST.B
(A2)+ | 4A1A
The stack looks like this:
Calling chain using A6 Links:
A6 Frame Caller
0001A692 10C0E4B4 SysAppLaunch+0480
0001A630 10C0F120 PrvCallWithNewStack+0016
0001E1A4 00025A28 __Startup__+5A28
0001E184 0002C958 PilotMain+0040
0001E162 0002C8DA EventLoop+00DC
0001E13C 10C697FC FrmDispatchEvent+0046
0001E120 10C65E7A PrvSendEventToForm+0036
0001E104 10C6AD6E FrmHandleEvent+039C
0001E0A4 10C5B386 CtlHandleEvent+00CC
0001E058 10C5A8A8 PrvDrawControl+01A8
I'm new to using the debugger and trying to interpret the results,
so any hints, (including the bleeding obvious) are appreciated.
What it looks like to me is that a NULL string was passed to
StrLen() inside a call to handle a control inside FrmHandleEvent.
Looking at the 3.0 source, I would have expected StrLen to complain
directly about this if a passed string was null, but I guess not. I
might add that under 3.3 debug, I can't reproduce the error.
The event handler code that handles the trigger looks like this:
VoidHand hndTriggerLabel = MemHandleNew( MAX_LENGTH );
...
switch ( event )
{
...
case popSelectEvent:
pTriggerLabel = MemHandleLock( hndTriggerLabel );
ASSERT( pTriggerLabel );
if ( pTriggerLabel )
{
StrCopy( pTriggerLabel, LstGetSelectionText( GetObjectPtr(
e->data.popSelect.listID ),
e->data.popSelect.selection ) );
CtlSetLabel( GetObjectPtr( e->data.popSelect.controlID ),
pTriggerLabel );
}
MemHandleUnlock( hndTriggerLabel );
wSelect = e->data.popSelect.selection;
iTime = GetZone( wSelect );
/* bHandled = true; Don't return true...the OS should handle this
*/
break;
}
_MemHandleFree( hndTriggerLabel );
What I'm especially mystified by is that setting a breakpoint at the
popSelectEvent will trap a tap on the trigger under 3.3 debug, but
under 3.5 debug, the breakpoint never executes...it appears to just
fall right through the event handler. Also, the app falls over
before the associated list is ever displayed.
I get the feeling I'm missing something obvious...I just can't
figure out what.
Cheers,
--
Andrew Ball
[EMAIL PROTECTED]