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

Method symbol_data

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

Source from the content-addressed store, hash-verified

334 }
335
336 pub fn symbol_data(&self, symbol_index: usize) -> Option<&[u8]> {
337 let symbol = self.symbols.get(symbol_index)?;
338 let section_index = symbol.section?;
339 let section = self.sections.get(section_index)?;
340 let offset = symbol.address.checked_sub(section.address)?;
341 section.data.get(offset as usize..offset as usize + symbol.size as usize)
342 }
343
344 pub fn symbol_by_name(&self, name: &str) -> Option<usize> {
345 self.symbols.iter().position(|symbol| symbol.section.is_some() && symbol.name == name)

Callers 5

get_string_dataFunction · 0.80
instruction_hoverFunction · 0.80
display_ins_data_labelsFunction · 0.80

Calls 1

getMethod · 0.80

Tested by

no test coverage detected