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

tracef

tracef( 
[ s_function | t_fileName ... | t ]
) 
=> g_result

Description

Turns on tracing of specified functions. Shows the functions called with their evaluated arguments and return values. This is an nlambda function.

The output port for tracing is ptport, which defaults to poport.

If you want to force certain functions not to be traced even though you have turned on tracing for many or all functions, you can add the property notrace with a non-nil value on the name of the function. For example, to prevent plus from being traced use putprop('plus t 'notrace ) or plus.notrace = t.

Arguments

s_function

Any function that you want to trace.

t_filename

Any file containing functions that you want to trace.

t

Turns tracing on for all functions.

Value Returned

g_result

Functions or files traced.

Examples

(defun f (x) (add1 x))    ; Defines a function f.
=> f
(tracef f                 ; Turns on tracing for f.
=> (f)
f(3) 
|f(3)
|f --> 4
=> 4
(tracef t                 ; Turns on tracing for all functions.
|tracef --> t
=> t
f(3)
|f(3)
||add1(3)
||add1 --> 4
|f --> 4
=> 4

Suppose testfuns.il defines functions f1 and f2:

(defun f1 (x) x+1)
(defun f2 (y) f1(y)+1)
installDebugger           ; debug was turned on before loading a file
=> t
1> load "testfuns.il"
=> t
1> tracef("testfuns.il") 
; tracing for all functions in the file
("testfuns.il")
1> f2 3
|f2(3)
||f1(3)
||f1 --> 4
|f2 --> 5
5

Related Topics

Debug Functions

tracev

untrace

untracev


Return to top
 ⠀
X