[]Struct symbolic::debuginfo::pdb::pdb::SectionOffset

pub struct SectionOffset {
    pub offset: u32,
    pub section: u16,
}

An offset relative to a PE section.

This offset can be converted to an Rva to receive the address relative to the entire image. Note that this offset applies to the actual PE headers. The PDB debug information actually stores PdbInternalSectionOffsets.

Fields

offset: u32

The memory offset relative from the start of the section's memory.

section: u16

The index of the section in the PE's section headers list, incremented by 1. A value of 0 indicates an invalid or missing reference.

Implementations

impl SectionOffset

pub fn to_rva(self, translator: &AddressMap<'_>) -> Option<Rva>

Resolves an actual Relative Virtual Address in the executable's address space.

pub fn to_internal_rva(
    self,
    translator: &AddressMap<'_>
) -> Option<PdbInternalRva>

Resolves a PDB-internal Relative Virtual Address.

This address is not necessarily compatible with the executable's address space and should therefore not be used for debugging purposes.

pub fn to_internal_offset(
    self,
    translator: &AddressMap<'_>
) -> Option<PdbInternalSectionOffset>

Resolves the PDB internal section offset.

impl SectionOffset

pub fn new(section: u16, offset: u32) -> SectionOffset

Creates a new section offset.

pub fn is_valid(self) -> bool

Returns whether this section offset points to a valid section or into the void.

pub fn checked_add(self, offset: u32) -> Option<SectionOffset>

Checked addition of an offset. Returns None if overflow occurred.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

pub fn saturating_add(self, offset: u32) -> SectionOffset

Saturating addition of an offset, clipped at the numeric bounds.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

pub fn wrapping_add(self, offset: u32) -> SectionOffset

Wrapping (modular) addition of an offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

Trait Implementations

impl Add<u32> for SectionOffset

type Output = SectionOffset

The resulting type after applying the + operator.

pub fn add(self, offset: u32) -> SectionOffset

Adds the given offset to this section offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

impl AddAssign<u32> for SectionOffset

pub fn add_assign(&mut self, offset: u32)

Adds the given offset to this section offset.

This does not check whether the offset is still valid within the given section. If the offset is out of bounds, the conversion to Rva will return None.

impl Clone for SectionOffset

impl Copy for SectionOffset

impl Debug for SectionOffset

impl Default for SectionOffset

impl Eq for SectionOffset

impl Hash for SectionOffset

impl PartialEq<SectionOffset> for SectionOffset

impl PartialOrd<SectionOffset> for SectionOffset

pub fn partial_cmp(&self, other: &SectionOffset) -> Option<Ordering>

Compares offsets if they reside in the same section.

impl StructuralEq for SectionOffset

impl StructuralPartialEq for SectionOffset

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.