Skip to content

Commit c0b867b

Browse files
committed
Show data literal values on instruction hover
Reimplements encounter#108
1 parent 9c31c82 commit c0b867b

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

objdiff-core/src/diff/display.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,16 @@ pub fn instruction_hover(
524524
}
525525
out.push(HoverItem::Separator);
526526
out.append(&mut symbol_hover(obj, reloc.relocation.target_symbol, reloc.relocation.addend));
527+
out.push(HoverItem::Separator);
528+
if let Some(ty) = obj.arch.guess_data_type(resolved) {
529+
for literal in display_ins_data_literals(obj, resolved) {
530+
out.push(HoverItem::Text {
531+
label: format!("{}", ty),
532+
value: literal,
533+
color: HoverItemColor::Normal,
534+
});
535+
}
536+
}
527537
}
528538
out
529539
}

0 commit comments

Comments
 (0)