Skip to content

Commit 1d91030

Browse files
committed
flesh out some docs a bit
1 parent b1db8eb commit 1d91030

File tree

2 files changed

+31
-5
lines changed

2 files changed

+31
-5
lines changed

minidump-processor/json-schema.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,14 @@ anyway.
306306
// So if displaying the frames you should do roughly:
307307
//
308308
// ```
309-
// for frame in thread.frames {
310-
// for inline in frame.inlines {
311-
// print_inline(frame, inline)
309+
// let mut frame_num = 0;
310+
// for frame in &thread.frames {
311+
// for inline in &frame.inlines {
312+
// print_inline(frame_num, frame, inline);
313+
// frame_num += 1;
312314
// }
313-
// print_frame(frame)
315+
// print_frame(frame_num, frame);
316+
// frame_num += 1;
314317
// }
315318
// ```
316319
//

minidump-processor/src/process_state.rs

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)]
6870
pub 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

Comments
 (0)