(obj: &Object, diff_row: &DataDiffRow)
| 549 | } |
| 550 | |
| 551 | pub fn data_row_context(obj: &Object, diff_row: &DataDiffRow) -> Vec<ContextItem> { |
| 552 | let mut out = Vec::new(); |
| 553 | let mut prev_reloc = None; |
| 554 | for reloc_diff in diff_row.relocations.iter() { |
| 555 | let reloc = &reloc_diff.reloc; |
| 556 | if prev_reloc == Some(reloc) { |
| 557 | // Avoid showing consecutive duplicate relocations. |
| 558 | // We do this because a single relocation can span across multiple diffs if the |
| 559 | // bytes in the relocation changed (e.g. first byte is added, second is unchanged). |
| 560 | continue; |
| 561 | } |
| 562 | prev_reloc = Some(reloc); |
| 563 | |
| 564 | let reloc = resolve_relocation(&obj.symbols, reloc); |
| 565 | out.append(&mut relocation_context(obj, reloc, None, None)); |
| 566 | } |
| 567 | out |
| 568 | } |
| 569 | |
| 570 | pub fn relocation_hover( |
| 571 | obj: &Object, |
no test coverage detected