@@ -63,7 +63,9 @@ pub struct FunctionArg {
6363 pub value : Option < u64 > ,
6464}
6565
66- /// A stack frame in an inlined function.
66+ /// A stack frame for an inlined function.
67+ ///
68+ /// See [`StackFrame::inlines`][] for more details.
6769#[ derive( Debug , Clone ) ]
6870pub struct InlineFrame {
6971 /// The name of the function
@@ -169,6 +171,27 @@ pub struct StackFrame {
169171 pub source_line_base : Option < u64 > ,
170172
171173 /// Any inline frames that cover the frame address, ordered from outside to inside.
174+ /// The frames are "fake" in that they don't actually exist at runtime, and are only
175+ /// known because the compiler added debuginfo saying they exist.
176+ ///
177+ /// As a result, many properties of these frames either don't exist or are
178+ /// in some sense "inherited" from the parent real frame. For instance they
179+ /// have the same instruction/module by definiton.
180+ ///
181+ /// If you were to print frames you would want to do something like:
182+ ///
183+ /// ```ignore
184+ /// let mut frame_num = 0;
185+ /// for frame in &thread.frames {
186+ /// // !!! Inlines come first, and need to be reversed
187+ /// for inline in frame.inlines.iter().rev() {
188+ /// print_inline(frame_num, frame, inline);
189+ /// frame_num += 1;
190+ /// }
191+ /// print_frame(frame_num, frame);
192+ /// frame_num += 1;
193+ /// }
194+ /// ```
172195 pub inlines : Vec < InlineFrame > ,
173196
174197 /// Amount of trust the stack walker has in the instruction pointer
0 commit comments