MCPcopy Index your code
hub / github.com/encounter/objdiff / display_ins_data_labels

Function display_ins_data_labels

objdiff-core/src/diff/display.rs:873–888  ·  view source on GitHub ↗
(obj: &Object, resolved: ResolvedInstructionRef)

Source from the content-addressed store, hash-verified

871}
872
873pub fn display_ins_data_labels(obj: &Object, resolved: ResolvedInstructionRef) -> Vec<String> {
874 let Some(reloc) = resolved.relocation else {
875 return Vec::new();
876 };
877 if reloc.relocation.addend < 0 || reloc.relocation.addend as u64 >= reloc.symbol.size {
878 return Vec::new();
879 }
880 let Some(data) = obj.symbol_data(reloc.relocation.target_symbol) else {
881 return Vec::new();
882 };
883 let bytes = &data[reloc.relocation.addend as usize..];
884 obj.arch
885 .guess_data_type(resolved, bytes)
886 .map(|ty| ty.display_labels(obj.endianness, bytes))
887 .unwrap_or_default()
888}
889
890pub fn display_ins_data_literals(
891 obj: &Object,

Callers

nothing calls this directly

Calls 3

symbol_dataMethod · 0.80
display_labelsMethod · 0.80
guess_data_typeMethod · 0.45

Tested by

no test coverage detected