MCPcopy Create free account
hub / github.com/Rust-for-Linux/klint / encode

Method encode

src/binary_analysis/dwarf.rs:120–129  ·  view source on GitHub ↗
(&self, section: SectionIndex, offset: i64)

Source from the content-addressed store, hash-verified

118 }
119
120 fn encode(&self, section: SectionIndex, offset: i64) -> Result<u64, Error> {
121 let (address, size) = self.forward_map[section.0];
122 if offset < -(Self::SECTION_GAP as i64 / 2)
123 || offset > (size + Self::SECTION_GAP / 2) as i64
124 {
125 Err(Error::UnexpectedElf("symbol offset too big"))?
126 }
127
128 Ok(address.wrapping_add(offset as _))
129 }
130
131 fn decode(&self, address: u64) -> Result<(SectionIndex, i64), Error> {
132 let address_plus_gap = address

Callers 9

finishMethod · 0.80
encode_alloc_idMethod · 0.80
encode_crate_numMethod · 0.80
encode_spanMethod · 0.80
encode_def_idMethod · 0.80
sql_load_with_spanMethod · 0.80
sql_store_with_spanMethod · 0.80
encode_valueMethod · 0.80
load_sectionFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected