[−][src]Struct symbolic_debuginfo::macho::MachObject
Mach Object containers, used for executables and debug companions on macOS and iOS.
Methods
impl<'d> MachObject<'d>
[src]
pub fn test(data: &[u8]) -> bool
[src]
Tests whether the buffer could contain a MachO object.
pub fn parse(data: &'d [u8]) -> Result<Self, MachError>
[src]
Tries to parse a MachO from the given slice.
pub fn file_format(&self) -> FileFormat
[src]
The container file format, which is always FileFormat::MachO
.
pub fn code_id(&self) -> Option<CodeId>
[src]
The code identifier of this object.
Mach objects use a UUID which is specified in the load commands that are part of the Mach header. This UUID is generated at compile / link time and is usually unique per compilation.
pub fn debug_id(&self) -> DebugId
[src]
The debug information identifier of a MachO file.
This uses the same UUID as code_id
.
pub fn arch(&self) -> Arch
[src]
The CPU architecture of this object, as specified in the Mach header.
pub fn kind(&self) -> ObjectKind
[src]
The kind of this object, as specified in the Mach header.
pub fn load_address(&self) -> u64
[src]
The address at which the image prefers to be loaded into memory.
MachO files store all internal addresses as if it was loaded at that address. When the image is actually loaded, that spot might already be taken by other images and so it must be relocated to a new address. At runtime, a relocation table manages the arithmetics behind this.
Addresses used in symbols
or debug_session
have already been rebased relative to that
load address, so that the caller only has to deal with addresses relative to the actual
start of the image.
pub fn has_symbols(&self) -> bool
[src]
Determines whether this object exposes a public symbol table.
ⓘImportant traits for MachOSymbolIterator<'d>pub fn symbols(&self) -> MachOSymbolIterator<'d>
[src]
Returns an iterator over symbols in the public symbol table.
pub fn symbol_map(&self) -> SymbolMap<'d>
[src]
Returns an ordered map of symbols in the symbol table.
pub fn has_debug_info(&self) -> bool
[src]
Determines whether this object contains debug information.
pub fn debug_session(&self) -> Result<DwarfDebugSession<'d>, DwarfError>
[src]
Constructs a debugging session.
A debugging session loads certain information from the object file and creates caches for efficient access to various records in the debug information. Since this can be quite a costly process, try to reuse the debugging session as long as possible.
MachO files generally use DWARF debugging information, which is also used by ELF containers on Linux.
Constructing this session will also work if the object does not contain debugging
information, in which case the session will be a no-op. This can be checked via
has_debug_info
.
pub fn has_unwind_info(&self) -> bool
[src]
Determines whether this object contains stack unwinding information.
pub fn data(&self) -> &'d [u8]
[src]
Returns the raw data of the ELF file.
pub fn requires_symbolmap(&self) -> bool
[src]
Checks whether this mach object contains hidden symbols.
This is an indication that BCSymbolMaps are needed to symbolicate crash reports correctly.
Trait Implementations
impl<'d> ObjectLike for MachObject<'d>
[src]
type Error = DwarfError
Errors thrown when reading information from this object.
type Session = DwarfDebugSession<'d>
A session that allows optimized access to debugging information.
fn file_format(&self) -> FileFormat
[src]
fn code_id(&self) -> Option<CodeId>
[src]
fn debug_id(&self) -> DebugId
[src]
fn arch(&self) -> Arch
[src]
fn kind(&self) -> ObjectKind
[src]
fn load_address(&self) -> u64
[src]
fn has_symbols(&self) -> bool
[src]
fn symbols(&self) -> DynIterator<Symbol>
[src]
fn symbol_map(&self) -> SymbolMap
[src]
fn has_debug_info(&self) -> bool
[src]
fn debug_session(&self) -> Result<Self::Session, Self::Error>
[src]
fn has_unwind_info(&self) -> bool
[src]
impl<'d> Dwarf<'d> for MachObject<'d>
[src]
fn endianity(&self) -> Endian
[src]
fn raw_data(&self, section_name: &str) -> Option<(u64, &'d [u8])>
[src]
fn section_data(&self, section: &str) -> Option<(u64, Cow<'data, [u8]>)>
[src]
Returns the offset and binary data of a section. Read more
fn has_section(&self, section: &str) -> bool
[src]
Determines whether the specified section exists. Read more
impl<'_> Debug for MachObject<'_>
[src]
impl<'slf, 'd: 'slf> AsSelf<'slf> for MachObject<'d>
[src]
type Ref = MachObject<'slf>
The Self
type with 'slf
lifetimes, returned by as_self
.
fn as_self(&'slf self) -> &Self::Ref
[src]
Auto Trait Implementations
impl<'d> Send for MachObject<'d>
impl<'d> Sync for MachObject<'d>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.