cfunc.debug
FlashBASIC 'debug' functionality from C.
Syntax
int _CP_debug(int expression)
Description
equivalent to the FlashBASIC statement: debug
The C function differs slightly however. The expression passed to _CP_debug will display as a pseudo line number within the FlashBASIC debugger. Variables within the C program are not known to the Flash debugger. For access to these, the user should use a system debugger such as 'dbx' or 'sdb'. The _CP_debug statement is useful however, as it may be used to set breakpoints in Flash subroutines that will be called later.
This function returns -1 if an error occurs. The error code is contained in _CP_errno.
Example
/* The following example enters the FlashBASIC debugger and then calls routine
'mysub'. */
CPSTR * s = _CP_mkstr('mysub');
int i = -1;
_CP_debug(1);
_CP_call(&i,s,0);
When run, the user may enter break points for the not-yet-executed subroutine
'mysub'. For example, to stop when 'mysub' reaches line
number 3, the user should type 'mysub:b$=3' followed by a
'g' at the debugger prompts. The Flash debugger will then break
within 'mysub' at line number 3.
See Also
User Comments
What do you think?
Share your experience or ask a question by using the form below.
Login to leave your comments.
