pub(super) struct MapsEntry {
    address: (usize, usize),
    perms: [char; 4],
    offset: usize,
    dev: (usize, usize),
    inode: usize,
    pathname: OsString,
}

Fields§

§address: (usize, usize)

start (inclusive) and limit (exclusive) of address range.

§perms: [char; 4]

The perms field are the permissions for the entry

r = read w = write x = execute s = shared p = private (copy on write)

§offset: usize

Offset into the file (or “whatever”).

§dev: (usize, usize)

device (major, minor)

§inode: usize

inode on the device. 0 indicates that no inode is associated with the memory region (e.g. uninitalized data aka BSS).

§pathname: OsString

Usually the file backing the mapping.

Note: The man page for proc includes a note about “coordination” by using readelf to see the Offset field in ELF program headers. pnkfelix is not yet sure if that is intended to be a comment on pathname, or what form/purpose such coordination is meant to have.

There are also some pseudo-paths: “[stack]”: The initial process’s (aka main thread’s) stack. “[stack:]”: a specific thread’s stack. (This was only present for a limited range of Linux verisons; it was determined to be too expensive to provide.) “[vdso]”: Virtual dynamically linked shared object “[heap]”: The process’s heap

The pathname can be blank, which means it is an anonymous mapping obtained via mmap.

Newlines in pathname are replaced with an octal escape sequence.

The pathname may have “(deleted)” appended onto it if the file-backed path has been deleted.

Note that modifications like the latter two indicated above imply that in general the pathname may be ambiguous. (I.e. you cannot tell if the denoted filename actually ended with the text “(deleted)”, or if that was added by the maps rendering.

Implementations§

source§

impl MapsEntry

source

pub(super) fn pathname(&self) -> &OsString

source

pub(super) fn ip_matches(&self, ip: usize) -> bool

Trait Implementations§

source§

impl Debug for MapsEntry

source§

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

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

impl FromStr for MapsEntry

§

type Err = &'static str

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<MapsEntry> for MapsEntry

source§

fn eq(&self, other: &MapsEntry) -> 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 Eq for MapsEntry

source§

impl StructuralEq for MapsEntry

source§

impl StructuralPartialEq for MapsEntry

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere 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 Twhere 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.