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

Method resolve_instruction_ref

objdiff-core/src/obj/mod.rs:314–334  ·  view source on GitHub ↗
(
        &self,
        symbol_index: usize,
        ins_ref: InstructionRef,
    )

Source from the content-addressed store, hash-verified

312
313impl Object {
314 pub fn resolve_instruction_ref(
315 &self,
316 symbol_index: usize,
317 ins_ref: InstructionRef,
318 ) -> Option<ResolvedInstructionRef<'_>> {
319 let symbol = self.symbols.get(symbol_index)?;
320 let section_index = symbol.section?;
321 let section = self.sections.get(section_index)?;
322 let offset = ins_ref.address.checked_sub(section.address)?;
323 let code = section.data.get(offset as usize..offset as usize + ins_ref.size as usize)?;
324 let relocation = section.resolve_relocation_at(self, ins_ref.address, ins_ref.size);
325 Some(ResolvedInstructionRef {
326 ins_ref,
327 symbol_index,
328 symbol,
329 section,
330 section_index,
331 code,
332 relocation,
333 })
334 }
335
336 pub fn symbol_data(&self, symbol_index: usize) -> Option<&[u8]> {
337 let symbol = self.symbols.get(symbol_index)?;

Callers 8

instruction_contextMethod · 0.80
instruction_hoverMethod · 0.80
ins_hover_uiFunction · 0.80
ins_context_menuFunction · 0.80
display_rowFunction · 0.80
diff_instructionFunction · 0.80
newMethod · 0.80
assert_literal_valueFunction · 0.80

Calls 2

getMethod · 0.80
resolve_relocation_atMethod · 0.80

Tested by 1

assert_literal_valueFunction · 0.64