Product Documentation
Cadence SKILL Development Reference
Product Version IC23.1, June 2023

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

u_function...

List of functions or function objects.

break_tag

Valid values:

call Breaks at the calling point after evaluating all arguments in the caller's context.

entry Breaks at the entry point after binding all formal parameters in the callee's context.

exit Breaks at the exit point in the callee's context.

return Breaks at the returning point in the caller's context.

g_condition

Condition expression to be evaluated in the associated break context.

Value Returned

g_result

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

break

cont, continue

unbreakpt

installDebugger

next

step

stepout


Return to top
 ⠀
X