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

where

where( 
[ g_unevaluated ] 
[ x_depth ] 
[ x_skip ] 
[ p_port ] 
) 
=> x_result

Description

Prints the functions on the stack and their arguments to the depth specified, or to the bottom of the stack, including the local variables and their bindings.

It is similar to stacktrace, but in addition to printing out the functions on the stack, it also prints out the local variables and their bindings. The where function observes the following rules:

This function is usually used inside the break or error handler.

Arguments

g_unevaluated

Prints the unevaluated function parameters.

x_depth

Number of stack levels to print. The default is all.

x_skip

Number of levels to skip. The default is 1.

p_port

Output port. Defaults to the error port if not specified.

Value Returned

x_result

Number of stack frames printed.

Examples

Suppose /tmp/color.il defines function initColor:

(defun initColor (object)
(let ((colorList '(red green yellow)) color)
(setq color (concat (get object 'color)))
(if (memq color colorList)
(printf "color %s initialized" (get object 'name)))
)
)

Try this file in debugger:

installDebugger
=> t
1> (sstatus sourceTracing t)
; Turns on sourceTracing to get line numbers
=> t
1>  load "/tmp/color.il"
=> t
1> (putprop 'object1 "green" 'color)
=> "green"
1> (initColor 'object1)
*** Error in routine fprintf/sprintf:
Message: *Error* fprintf/sprintf: format spec. incompatible
with data
Debug 2> where
<<< Stack Trace >>>
errorHandler("fprintf/sprintf" 0 t nil ("*Error* fprintf/sprintf: format spec. incompatible with data" nil))
printf("color %s initialized" get(object 'name))
at line 5 in file /tmp/color.il
if(memq(color colorList) printf("color %s initialized" get(object 'name)))
let(((colorList '&) color) (color = concat(get(object &))) if(memq(color colorList) printf("color %s initialized" get(object &))))
colorList = (red green yellow)
color = green
object = object1
initColor('object1)
5

Related Topics

Debug Functions

sstatus

stacktrace


Return to top
 ⠀
X