breakpt
breakpt( [u_function[break_condition] ] ) where break_condition can be either (break_tag g_condition) or ( (break_tag g_condition)... ) =>g_result
Description
Sets breakpoints on one or more functions or function objects.
The SKILL debugger is the default break handler and is entered automatically when a breakpoint is encountered. The functions breakpt and unbreakpt set and clear breakpoints on the given functions or function objects.
Another way to enter the break handler is to insert the break function directly into a SKILL function at the point desired. Once you are in the break handler, you can examine the state of the program. If the function was loaded under debugMode (see installDebugger), you can use single stepping functions such as step, next, stepout, or continue.
If break_condition is not specified, the breakpoint is called unconditional. The behavior of an unconditional breakpoint is as follows: if the function is read-protected or not yet defined under debugMode, the breakpoint is assumed to be set at the call point. Otherwise, it is assumed to be set at the entry point of the function.
Arguments
Value Returned
|
List of functions or function objects on which the breakpoints have been set. |
Examples
The following example sets a breakpoint, enters the break handler, continues, and finally clears the breakpoint.
installDebugger( ) ; Make sure debug mode is on.
breakpt( times ) ; Sets a breakpoint on times.
times(2 plus( 2 3 )) ; Invokes the break handler.
cont( ) ; Continue executing.
unbreakpt( times ) ; Clear the breakpoint.
This example sets a conditional breakpoint.
(breakpt myFun hisFun)
(breakpt myFun1 (entry n > 5))
(breakpt myFun2 ((entry n > 5) (exit result != 0)) hisFun)
The following example sets breakpoint on a function object.
(installDebugger) ; Make sure debug mode is on
=> t
(defun test (x) (printf "test : x == %L\n" x))
=> test
(putd 'test1 (getd 'test)) ;test and test1 are the same functions
=> funobj:test
(funcall 'breakpt (getd 'test)) ;set breakpoint on the funobject
(funobj:test)
(test1 8)
<<< Break >>> on entering test
Entering new debug toplevel due to breakpoint:
Debug 2> cont
test : x == 8
=> t
Related Topics
Return to top