pub struct ExplicitModuleSectionInfo<D> {
Show 14 fields pub base_svma: u64, pub text_svma: Option<Range<u64>>, pub text: Option<D>, pub stubs_svma: Option<Range<u64>>, pub stub_helper_svma: Option<Range<u64>>, pub got_svma: Option<Range<u64>>, pub unwind_info: Option<D>, pub eh_frame_svma: Option<Range<u64>>, pub eh_frame: Option<D>, pub eh_frame_hdr_svma: Option<Range<u64>>, pub eh_frame_hdr: Option<D>, pub debug_frame: Option<D>, pub text_segment_svma: Option<Range<u64>>, pub text_segment: Option<D>,
}
Expand description

Explicit addresses and data of various sections in the module. This implements the ModuleSectionInfo trait.

Unless otherwise stated, these are SVMAs, “stated virtual memory addresses”, i.e. addresses as stated in the object, as opposed to AVMAs, “actual virtual memory addresses”, i.e. addresses in the virtual memory of the profiled process.

Code addresses inside a module’s unwind information are usually written down as SVMAs, or as relative addresses. For example, DWARF CFI can have code addresses expressed as relative-to-.text addresses or as absolute SVMAs. And mach-O compact unwind info contains addresses relative to the image base address.

Fields§

§base_svma: u64

The image base address, as stated in the object. For mach-O objects, this is the vmaddr of the __TEXT segment. For ELF objects, this is zero.

This is used to convert between SVMAs and relative addresses.

§text_svma: Option<Range<u64>>

The address range of the __text or .text section. This is where most of the compiled code is stored.

This is used to detect whether we need to do instruction analysis for an address.

§text: Option<D>

The data of the __text or .text section. This is where most of the compiled code is stored. For mach-O binaries, this does not need to be supplied if text_segment is supplied.

This is used to handle function prologues and epilogues in some cases.

§stubs_svma: Option<Range<u64>>

The address range of the mach-O __stubs section. Contains small pieces of executable code for calling imported functions. Code inside this section is not covered by the unwind information in __unwind_info.

This is used to exclude addresses in this section from incorrectly applying __unwind_info opcodes. It is also used to infer unwind rules for the known structure of stub functions.

§stub_helper_svma: Option<Range<u64>>

The address range of the mach-O __stub_helper section. Contains small pieces of executable code for calling imported functions. Code inside this section is not covered by the unwind information in __unwind_info.

This is used to exclude addresses in this section from incorrectly applying __unwind_info opcodes. It is also used to infer unwind rules for the known structure of stub helper functions.

§got_svma: Option<Range<u64>>

The address range of the .got section (Global Offset Table). This is used during DWARF CFI processing, to resolve got-relative addresses.

§unwind_info: Option<D>

The data of the __unwind_info section of mach-O binaries.

§eh_frame_svma: Option<Range<u64>>

The address range of the __eh_frame or .eh_frame section. This is used during DWARF CFI processing, to resolve eh_frame-relative addresses.

§eh_frame: Option<D>

The data of the __eh_frame or .eh_frame section. This is used during DWARF CFI processing, to resolve eh_frame-relative addresses.

§eh_frame_hdr_svma: Option<Range<u64>>

The address range of the .eh_frame_hdr section. This is used during DWARF CFI processing, to resolve eh_frame_hdr-relative addresses.

§eh_frame_hdr: Option<D>

The data of the .eh_frame_hdr section. This is used during DWARF CFI processing, to resolve eh_frame_hdr-relative addresses.

§debug_frame: Option<D>

The data of the .debug_frame section. The related address range is not needed.

§text_segment_svma: Option<Range<u64>>

The address range of the __TEXT segment of mach-O binaries, if available.

§text_segment: Option<D>

The data of the __TEXT segment of mach-O binaries, if available.

Trait Implementations§

source§

impl<D: Clone> Clone for ExplicitModuleSectionInfo<D>

source§

fn clone(&self) -> ExplicitModuleSectionInfo<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug> Debug for ExplicitModuleSectionInfo<D>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D: Default> Default for ExplicitModuleSectionInfo<D>

source§

fn default() -> ExplicitModuleSectionInfo<D>

Returns the “default value” for a type. Read more
source§

impl<D> ModuleSectionInfo<D> for ExplicitModuleSectionInfo<D>
where D: Deref<Target = [u8]>,

source§

fn base_svma(&self) -> u64

Return the base address stated in the module. Read more
source§

fn section_svma_range(&mut self, name: &[u8]) -> Option<Range<u64>>

Get the given section’s memory range, as stated in the module.
source§

fn section_data(&mut self, name: &[u8]) -> Option<D>

Get the given section’s data. This will only be called once per section.
source§

fn segment_svma_range(&mut self, name: &[u8]) -> Option<Range<u64>>

Get the given segment’s memory range, as stated in the module.
source§

fn segment_data(&mut self, name: &[u8]) -> Option<D>

Get the given segment’s data. This will only be called once per segment.
source§

impl<D: PartialEq> PartialEq for ExplicitModuleSectionInfo<D>

source§

fn eq(&self, other: &ExplicitModuleSectionInfo<D>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<D: Eq> Eq for ExplicitModuleSectionInfo<D>

source§

impl<D> StructuralEq for ExplicitModuleSectionInfo<D>

source§

impl<D> StructuralPartialEq for ExplicitModuleSectionInfo<D>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.