diff --git a/atorsl/src/symbolicator.rs b/atorsl/src/symbolicator.rs index 03bcb0b..a272863 100644 --- a/atorsl/src/symbolicator.rs +++ b/atorsl/src/symbolicator.rs @@ -219,22 +219,31 @@ impl DwarfExt for Dwarf<'_> { ) -> Result { let mut source_locs = Vec::default(); + let mut prev_row: Option = None; while let Some((header, line_row)) = line_rows.next_row()? { - if line_row.end_sequence() || line_row.address() != addr { - continue; + if let Some(prev_row_value) = prev_row { + let previous_match = prev_row_value.address() <= addr && addr < line_row.address(); + + if previous_match { + source_locs.push(SourceLoc { + file: self.line_row_file(&prev_row_value, header, unit)?, + line: prev_row_value + .line() + .map(|line| line.get()) + .unwrap_or_default(), + col: match prev_row_value.column() { + ColumnType::LeftEdge => 0, + ColumnType::Column(col) => col.get(), + }, + }); + } } - source_locs.push(SourceLoc { - file: self.line_row_file(line_row, header, unit)?, - line: line_row - .line() - .map(|line| line.get()) - .unwrap_or_default(), - col: match line_row.column() { - ColumnType::LeftEdge => 0, - ColumnType::Column(col) => col.get(), - }, - }); + prev_row = Some(line_row.to_owned()); + + if line_row.end_sequence() { + prev_row = None; + } } source_locs diff --git a/fixtures/test_symr.txt b/fixtures/test_symr.txt index 5a01422..e280470 100644 --- a/fixtures/test_symr.txt +++ b/fixtures/test_symr.txt @@ -11643,11 +11643,11 @@ _DATA__TtC12Rollbar_Demo11AppDelegate (in test.dwarf) + 0 full type metadata for AppDelegate (in test.dwarf) + 0 -type metadata for AppDelegate (in test.dwarf) + 0 OBJC_CLASS_$__TtC12Rollbar_Demo11AppDelegate (in test.dwarf) + 0 - type metadata for AppDelegate (in test.dwarf) + 0 + OBJC_CLASS_$__TtC12Rollbar_Demo11AppDelegate (in test.dwarf) + 0 +type metadata for AppDelegate (in test.dwarf) + 0 OBJC_METACLASS_$_RollbarAppLanguageUtil (in test.dwarf) + 0