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

stacktrace

stacktrace( 
[ 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 if no depth is specified.

The function observes the following rules:

stacktrace has a more flexible interface for user convenience. Thus if the first argument is a number it will interpret it to be x_depth, otherwise if it is non-nil it will take it to be g_unevaluated.

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

Arguments

g_unevaluated

Always prints the unevaluated function parameters.

x_depth

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

x_skip

stacktrace skips over the number of function calls specified by x_skip. This argument defaults to 1.

p_port

Port for the stacktrace output. The default is error port.

Value Returned

x_result

The number of stack frames printed.

Examples

Prints all the functions on the stack.

stacktrace()

Prints the top five functions on the stack.

stacktrace( 5 )

Prints the five functions on the stack that come after the first three to the trace port.

stacktrace( t 5 3 ptport ) 

Prints the first six stack frames every time an error occurs.

sstatus( stacktrace 6 )

Related Topics

breakpt

cont, continue

installDebugger

step

stepend

stepout

unbreakpt

uninstallDebugger


Return to top
 ⠀
X