Struct symbolic_debuginfo::macho::MachObject [−][src]
Mach Object containers, used for executables and debug companions on macOS and iOS.
Implementations
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 name(&self) -> Option<&'d str>
[src]
The name of the dylib if any.
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.
pub fn symbols(&self) -> MachOSymbolIterator<'d>ⓘNotable traits for MachOSymbolIterator<'data>
impl<'data> Iterator for MachOSymbolIterator<'data> type Item = Symbol<'data>;
[src]
Notable traits for MachOSymbolIterator<'data>
impl<'data> Iterator for MachOSymbolIterator<'data> type Item = Symbol<'data>;
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 has_sources(&self) -> bool
[src]
Determines whether this object contains embedded source.
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<'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]
impl Debug for MachObject<'_>
[src]
impl<'data> Dwarf<'data> for MachObject<'data>
[src]
fn endianity(&self) -> Endian
[src]
fn raw_section(&self, section_name: &str) -> Option<DwarfSection<'data>>
[src]
fn section(&self, name: &str) -> Option<DwarfSection<'data>>
[src]
fn has_section(&self, name: &str) -> bool
[src]
impl<'data: 'object, 'object> ObjectLike<'data, 'object> for MachObject<'data>
[src]
type Error = DwarfError
Errors thrown when reading information from this object.
type Session = DwarfDebugSession<'data>
A session that allows optimized access to debugging information.
type SymbolIterator = MachOSymbolIterator<'data>
The iterator over the symbols in the public symbol table.
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) -> Self::SymbolIterator
[src]
fn symbol_map(&self) -> SymbolMap<'data>
[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]
fn has_sources(&self) -> bool
[src]
Auto Trait Implementations
impl<'d> RefUnwindSafe for MachObject<'d>
impl<'d> Send for MachObject<'d>
impl<'d> Sync for MachObject<'d>
impl<'d> Unpin for MachObject<'d>
impl<'d> UnwindSafe for MachObject<'d>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,