[−][src]Struct pdb::PdbInternalSectionOffset
An offset relative to a PE section in the original unoptimized binary.
For optimized Microsoft binaries, this offset points to a virtual address space before the
rearrangement of sections has been performed. This kind of offset is usually stored in PDB debug
information. It can be converted to an RVA in the transformed address space of the optimized
binary using rva
. Likewise, there is a conversion to SectionOffset
in the actual address
space.
For binaries and their PDBs that have not been optimized, both address spaces are equal and the offsets are interchangeable. The conversion operations are cheap no-ops in this case.
Fields
offset: u32
The memory offset relative from the start of the section's memory.
section: u16
The index of the section in the PDB's section headers list, incremented by 1
. A value of
0
indicates an invalid or missing reference.
Methods
impl PdbInternalSectionOffset
[src]
pub fn new(section: u16, offset: u32) -> Self
[src]
Creates a new section offset.
pub fn is_valid(self) -> bool
[src]
Returns whether this section offset points to a valid section or into the void.
pub fn checked_add(self, offset: u32) -> Option<Self>
[src]
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) -> Self
[src]
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) -> Self
[src]
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
.
impl PdbInternalSectionOffset
[src]
pub fn to_rva(self, translator: &AddressMap) -> Option<Rva>
[src]
Resolves an actual Relative Virtual Address in the executable's address space.
pub fn to_internal_rva(self, translator: &AddressMap) -> Option<PdbInternalRva>
[src]
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_section_offset(self, translator: &AddressMap) -> Option<SectionOffset>
[src]
Resolves the section offset in the PE headers.
Trait Implementations
impl Copy for PdbInternalSectionOffset
[src]
impl Clone for PdbInternalSectionOffset
[src]
fn clone(&self) -> PdbInternalSectionOffset
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq<PdbInternalSectionOffset> for PdbInternalSectionOffset
[src]
fn eq(&self, other: &PdbInternalSectionOffset) -> bool
[src]
fn ne(&self, other: &PdbInternalSectionOffset) -> bool
[src]
impl PartialOrd<PdbInternalSectionOffset> for PdbInternalSectionOffset
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
Compares offsets if they reside in the same section.
#[must_use]
default fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
default fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
default fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
default fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Eq for PdbInternalSectionOffset
[src]
impl Default for PdbInternalSectionOffset
[src]
fn default() -> PdbInternalSectionOffset
[src]
impl Hash for PdbInternalSectionOffset
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Add<u32> for PdbInternalSectionOffset
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, offset: u32) -> Self
[src]
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 Debug for PdbInternalSectionOffset
[src]
impl<'a> TryFromCtx<'a, Endian, [u8]> for PdbInternalSectionOffset where
PdbInternalSectionOffset: 'a,
[src]
PdbInternalSectionOffset: 'a,
Auto Trait Implementations
impl Send for PdbInternalSectionOffset
impl Sync for PdbInternalSectionOffset
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
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>,