2 .\" This file and its contents are supplied under the terms of the
3 .\" Common Development and Distribution License ("CDDL"), version 1.0.
4 .\" You may only use this file in accordance with the terms of version
7 .\" A full copy of the text of the CDDL should have accompanied this
8 .\" source. A copy of the CDDL is also available via the Internet at
9 .\" http://www.illumos.org/license/CDDL.
12 .\" Copyright 2015 Joyent, Inc.
19 .Nd iterate process stack frames
26 .Fa "struct ps_prochandle *P"
27 .Fa "const prgregset_t regs"
28 .Fa "proc_stack_f *func"
34 function iterates over the stack frames in the process
36 starting at the point defined by
39 For each valid stack frame encountered, the callback function
48 With each callback, a register set, argument set, and argument count
50 In that register set, only a subset of the registers will be valid, which
51 include the frame pointer, program counter, and on SPARC systems, the next
53 These registers can be accessed with the constants
59 These correspond to the registers
72 on both SPARC and SPARCv9.
74 Callers will receive a callback for the first stack frame indicated by
76 and then will receive a subsequent callback for each caller of that
77 frame until no such frame can be found.
78 Stack frames that logically come after the frame indicated by
80 will not receive callbacks.
82 The compiler can either facilitate or stymie the iteration of the stack.
83 Programs that have been compiled in such a way as to omit the frame pointer will
84 result in truncated stacks.
85 Similarly, if the initial set of registers passed in via
87 is invalid, then the ability to iterate the stack will be limited.
90 controls whether or not iteration continues.
95 then iteration continues.
98 returns non-zero, then iteration will halt and that value will be used
99 as the return value of the
106 on internal failure it is recommended the callback function not return
108 to indicate an error.
109 Thus the caller may distinguish between the failure of the callback function and
114 Upon successful completion, the
118 If there was an internal error then
121 Otherwise, if the callback function
123 returns non-zero, then its return value will be returned instead.
124 .Sh INTERFACE STABILITY