Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 17 additions & 9 deletions symbolic-debuginfo/src/breakpad.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ pub struct BreakpadObject<'data> {
arch: Arch,
module: BreakpadModuleRecord<'data>,
data: &'data [u8],
max_inline_depth: u32,
max_function_parse_depth: u32,
}

impl<'data> BreakpadObject<'data> {
Expand Down Expand Up @@ -1000,7 +1000,7 @@ impl<'data> BreakpadObject<'data> {
.map_err(|_| BreakpadErrorKind::InvalidArchitecture)?,
module,
data,
max_inline_depth: opts.max_inline_depth,
max_function_parse_depth: opts.max_function_parse_depth,
})
}

Expand Down Expand Up @@ -1089,7 +1089,7 @@ impl<'data> BreakpadObject<'data> {
Ok(BreakpadDebugSession {
file_map: self.file_map(),
lines: Lines::new(self.data),
max_inline_depth: self.max_inline_depth,
max_function_parse_depth: self.max_function_parse_depth,
})
}

Expand Down Expand Up @@ -1282,13 +1282,17 @@ impl<'data> Iterator for BreakpadSymbolIterator<'data> {
pub struct BreakpadDebugSession<'data> {
file_map: BreakpadFileMap<'data>,
lines: Lines<'data>,
max_inline_depth: u32,
max_function_parse_depth: u32,
}

impl BreakpadDebugSession<'_> {
/// Returns an iterator over all functions in this debug file.
pub fn functions(&self) -> BreakpadFunctionIterator<'_> {
BreakpadFunctionIterator::new(&self.file_map, self.lines.clone(), self.max_inline_depth)
BreakpadFunctionIterator::new(
&self.file_map,
self.lines.clone(),
self.max_function_parse_depth,
)
}

/// Returns an iterator over all source files in this debug file.
Expand Down Expand Up @@ -1359,18 +1363,22 @@ pub struct BreakpadFunctionIterator<'s> {
next_line: Option<&'s [u8]>,
inline_origin_map: BreakpadInlineOriginMap<'s>,
lines: Lines<'s>,
max_inline_depth: u32,
max_function_parse_depth: u32,
}

impl<'s> BreakpadFunctionIterator<'s> {
fn new(file_map: &'s BreakpadFileMap<'s>, mut lines: Lines<'s>, max_inline_depth: u32) -> Self {
fn new(
file_map: &'s BreakpadFileMap<'s>,
mut lines: Lines<'s>,
max_function_parse_depth: u32,
) -> Self {
let next_line = lines.next();
Self {
file_map,
next_line,
inline_origin_map: Default::default(),
lines,
max_inline_depth,
max_function_parse_depth,
}
}
}
Expand Down Expand Up @@ -1414,7 +1422,7 @@ impl<'s> Iterator for BreakpadFunctionIterator<'s> {
b"",
fun_record.address,
fun_record.size,
self.max_inline_depth,
self.max_function_parse_depth,
);

for line in self.lines.by_ref() {
Expand Down
Loading
Loading