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
25 .Fa "struct ps_prochandle *P"
26 .Fa "const prgregset_t regs"
27 .Fa "proc_stack_f *func"
33 function iterates over the stack frames in the process
35 starting at the point defined by
38 For each valid stack frame encountered, the callback function
47 With each callback, a register set, argument set, and argument count
49 In that register set, only a subset of the registers will be valid, which
50 include the frame pointer, program counter, and on SPARC systems, the next
52 These registers can be accessed with the constants
58 These correspond to the registers
71 on both SPARC and SPARCv9.
73 Callers will receive a callback for the first stack frame indicated by
75 and then will receive a subsequent callback for each caller of that
76 frame until no such frame can be found.
77 Stack frames that logically come after the frame indicated by
79 will not receive callbacks.
81 The compiler can either facilitate or stymie the iteration of the stack.
82 Programs that have been compiled in such a way as to omit the frame pointer will
83 result in truncated stacks.
84 Similarly, if the initial set of registers passed in via
86 is invalid, then the ability to iterate the stack will be limited.
89 controls whether or not iteration continues.
94 then iteration continues.
97 returns non-zero, then iteration will halt and that value will be used
98 as the return value of the
105 on internal failure it is recommended the callback function not return
107 to indicate an error.
108 Thus the caller may distinguish between the failure of the callback function and
113 Upon successful completion, the
117 If there was an internal error then
120 Otherwise, if the callback function
122 returns non-zero, then its return value will be returned instead.
123 .Sh INTERFACE STABILITY