@@ -63,7 +63,9 @@ pub struct FunctionArg {
63
63
pub value : Option < u64 > ,
64
64
}
65
65
66
- /// A stack frame in an inlined function.
66
+ /// A stack frame for an inlined function.
67
+ ///
68
+ /// See [`StackFrame::inlines`][] for more details.
67
69
#[ derive( Debug , Clone ) ]
68
70
pub struct InlineFrame {
69
71
/// The name of the function
@@ -169,6 +171,27 @@ pub struct StackFrame {
169
171
pub source_line_base : Option < u64 > ,
170
172
171
173
/// 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
+ /// ```
172
195
pub inlines : Vec < InlineFrame > ,
173
196
174
197
/// Amount of trust the stack walker has in the instruction pointer
0 commit comments