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

Function display_ins_data_literals

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

Source from the content-addressed store, hash-verified

888}
889
890pub fn display_ins_data_literals(
891 obj: &Object,
892 resolved: ResolvedInstructionRef,
893) -> Vec<LiteralInfo> {
894 let Some(reloc) = resolved.relocation else {
895 return Vec::new();
896 };
897 if reloc.relocation.addend < 0 || reloc.relocation.addend as u64 >= reloc.symbol.size {
898 return Vec::new();
899 }
900 let Some(data) = obj.symbol_data(reloc.relocation.target_symbol) else {
901 return Vec::new();
902 };
903 let bytes = &data[reloc.relocation.addend as usize..];
904 obj.arch
905 .guess_data_type(resolved, bytes)
906 .map(|ty| ty.display_literals(obj.endianness, bytes))
907 .unwrap_or_default()
908}

Callers 4

relocation_contextFunction · 0.85
instruction_hoverFunction · 0.85
ins_data_literals_eqFunction · 0.85
assert_literal_valueFunction · 0.85

Calls 3

symbol_dataMethod · 0.80
display_literalsMethod · 0.80
guess_data_typeMethod · 0.45

Tested by 1

assert_literal_valueFunction · 0.68