[−][src]Struct pdb::SectionOffset
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.
Methods
impl SectionOffset
[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 SectionOffset
[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_internal_offset(
self,
translator: &AddressMap
) -> Option<PdbInternalSectionOffset>
[src]
self,
translator: &AddressMap
) -> Option<PdbInternalSectionOffset>
Resolves the PDB internal section offset.
Trait Implementations
impl Add<u32> for SectionOffset
[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 AddAssign<u32> for SectionOffset
[src]
fn add_assign(&mut self, offset: u32)
[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 Clone for SectionOffset
[src]
fn clone(&self) -> SectionOffset
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for SectionOffset
[src]
impl Debug for SectionOffset
[src]
impl Default for SectionOffset
[src]
fn default() -> SectionOffset
[src]
impl Eq for SectionOffset
[src]
impl Hash for SectionOffset
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SectionOffset> for SectionOffset
[src]
fn eq(&self, other: &SectionOffset) -> bool
[src]
fn ne(&self, other: &SectionOffset) -> bool
[src]
impl PartialOrd<SectionOffset> for SectionOffset
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
Compares offsets if they reside in the same section.
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for SectionOffset
[src]
impl StructuralPartialEq for SectionOffset
[src]
Auto Trait Implementations
impl RefUnwindSafe for SectionOffset
impl Send for SectionOffset
impl Sync for SectionOffset
impl Unpin for SectionOffset
impl UnwindSafe for SectionOffset
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,
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,