Struct gimli::DebugStr
[−]
[src]
pub struct DebugStr<'input, Endian> where Endian: Endianity { /* fields omitted */ }
The DebugStr
struct represents the DWARF strings
found in the .debug_str
section.
Methods
impl<'input, Endian> DebugStr<'input, Endian> where Endian: Endianity
[src]
fn new(debug_str_section: &'input [u8]) -> DebugStr<'input, Endian>
Construct a new DebugStr
instance from the data in the .debug_str
section.
It is the caller's responsibility to read the .debug_str
section and
present it as a &[u8]
slice. That means using some ELF loader on
Linux, a Mach-O loader on OSX, etc.
use gimli::{DebugStr, LittleEndian}; let debug_str = DebugStr::<LittleEndian>::new(read_debug_str_section_somehow());
fn get_str(&self, offset: DebugStrOffset) -> Result<&'input CStr>
Lookup a string from the .debug_str
section by DebugStrOffset.
use gimli::{DebugStr, DebugStrOffset, LittleEndian}; let debug_str = DebugStr::<LittleEndian>::new(read_debug_str_section_somehow()); println!("Found string {:?}", debug_str.get_str(debug_str_offset_somehow()));
Trait Implementations
impl<'input, Endian: Debug> Debug for DebugStr<'input, Endian> where Endian: Endianity
[src]
impl<'input, Endian: Clone> Clone for DebugStr<'input, Endian> where Endian: Endianity
[src]
fn clone(&self) -> DebugStr<'input, Endian>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more