pub trait SharedLibrary: Sized + Debug {
type Segment: Segment<SharedLibrary = Self>;
type SegmentIter: Debug + Iterator<Item = Self::Segment>;
// Required methods
fn name(&self) -> &OsStr;
fn id(&self) -> Option<SharedLibraryId>;
fn segments(&self) -> Self::SegmentIter;
fn virtual_memory_bias(&self) -> Bias;
fn each<F, C>(f: F)
where F: FnMut(&Self) -> C,
C: Into<IterationControl>;
// Provided methods
fn debug_name(&self) -> Option<&OsStr> { ... }
fn debug_id(&self) -> Option<SharedLibraryId> { ... }
fn actual_load_addr(&self) -> Avma { ... }
fn stated_load_addr(&self) -> Svma { ... }
fn len(&self) -> usize { ... }
fn avma_to_svma(&self, address: Avma) -> Svma { ... }
}
Expand description
A trait representing a shared library that is loaded in this process.
Required Associated Types§
Sourcetype Segment: Segment<SharedLibrary = Self>
type Segment: Segment<SharedLibrary = Self>
The associated segment type for this shared library.
Sourcetype SegmentIter: Debug + Iterator<Item = Self::Segment>
type SegmentIter: Debug + Iterator<Item = Self::Segment>
An iterator over a shared library’s segments.
Required Methods§
Sourcefn id(&self) -> Option<SharedLibraryId>
fn id(&self) -> Option<SharedLibraryId>
Get the code-id of this shared library if available.
Sourcefn segments(&self) -> Self::SegmentIter
fn segments(&self) -> Self::SegmentIter
Iterate over this shared library’s segments.
Sourcefn virtual_memory_bias(&self) -> Bias
fn virtual_memory_bias(&self) -> Bias
Get the bias of this shared library.
See the module documentation for details.
Provided Methods§
Sourcefn debug_name(&self) -> Option<&OsStr>
fn debug_name(&self) -> Option<&OsStr>
Get the name of the debug file with this shared library if there is one.
Sourcefn debug_id(&self) -> Option<SharedLibraryId>
fn debug_id(&self) -> Option<SharedLibraryId>
Get the debug-id of this shared library if available.
Sourcefn actual_load_addr(&self) -> Avma
fn actual_load_addr(&self) -> Avma
Returns the address of where the library is loaded into virtual memory.
This address maps to the Avma
of the first segment loaded into
memory. Depending on the platform, this segment may not contain code.
Sourcefn stated_load_addr(&self) -> Svma
fn stated_load_addr(&self) -> Svma
Returns the address of where the library prefers to be loaded into virtual memory.
This address maps to the Svma
of the first segment loaded into
memory. Depending on the platform, this segment may not contain code.
Sourcefn len(&self) -> usize
fn len(&self) -> usize
Returns the size of the image.
This typically is the size of the executable code segment. This is normally used by server side symbolication systems to determine when an IP no longer falls into an image.
Sourcefn avma_to_svma(&self, address: Avma) -> Svma
fn avma_to_svma(&self, address: Avma) -> Svma
Given an AVMA within this shared library, convert it back to an SVMA by removing this shared library’s bias.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.