Struct minidump_writer::ptrace_dumper::PtraceDumper
source · pub struct PtraceDumper {
pub pid: Pid,
pub threads: Vec<Thread>,
pub auxv: HashMap<u32, u32>,
pub mappings: Vec<MappingInfo>,
pub page_size: usize,
/* private fields */
}
Fields§
§pid: Pid
§threads: Vec<Thread>
§auxv: HashMap<u32, u32>
§mappings: Vec<MappingInfo>
§page_size: usize
Implementations§
source§impl PtraceDumper
impl PtraceDumper
sourcepub fn new(pid: Pid, stop_timeout: Duration) -> Result<Self, InitError>
pub fn new(pid: Pid, stop_timeout: Duration) -> Result<Self, InitError>
Constructs a dumper for extracting information of a given process with a process ID of |pid|.
pub fn init(&mut self, stop_timeout: Duration) -> Result<(), InitError>
pub fn late_init(&mut self) -> Result<(), InitError>
sourcepub fn copy_from_process(
child: Pid,
src: *mut c_void,
num_of_bytes: usize
) -> Result<Vec<u8>, DumperError>
pub fn copy_from_process( child: Pid, src: *mut c_void, num_of_bytes: usize ) -> Result<Vec<u8>, DumperError>
Copies content of |length| bytes from a given process |child|, starting from |src|, into |dest|. This method uses ptrace to extract the content from the target process. Always returns true.
sourcepub fn suspend_thread(child: Pid) -> Result<(), DumperError>
pub fn suspend_thread(child: Pid) -> Result<(), DumperError>
Suspends a thread by attaching to it.
sourcepub fn resume_thread(child: Pid) -> Result<(), DumperError>
pub fn resume_thread(child: Pid) -> Result<(), DumperError>
Resumes a thread by detaching from it.
pub fn suspend_threads(&mut self) -> Result<(), DumperError>
pub fn resume_threads(&mut self) -> Result<(), DumperError>
sourcepub fn get_thread_info_by_index(
&self,
index: usize
) -> Result<ThreadInfo, ThreadInfoError>
pub fn get_thread_info_by_index( &self, index: usize ) -> Result<ThreadInfo, ThreadInfoError>
Read thread info from /proc/$pid/status. Fill out the |tgid|, |ppid| and |pid| members of |info|. If unavailable, these members are set to -1. Returns true if all three members are available.
pub fn get_stack_info( &self, int_stack_pointer: usize ) -> Result<(usize, usize), DumperError>
pub fn sanitize_stack_copy( &self, stack_copy: &mut [u8], stack_pointer: usize, sp_offset: usize ) -> Result<(), DumperError>
pub fn find_mapping(&self, address: usize) -> Option<&MappingInfo>
pub fn find_mapping_no_bias(&self, address: usize) -> Option<&MappingInfo>
pub fn elf_file_identifier_from_mapped_file( mem_slice: &[u8] ) -> Result<Vec<u8>, DumperError>
pub fn elf_identifier_for_mapping_index( &mut self, idx: usize ) -> Result<Vec<u8>, DumperError>
pub fn elf_identifier_for_mapping( mapping: &mut MappingInfo, pid: Pid ) -> Result<Vec<u8>, DumperError>
Trait Implementations§
source§impl Debug for PtraceDumper
impl Debug for PtraceDumper
Auto Trait Implementations§
impl Freeze for PtraceDumper
impl RefUnwindSafe for PtraceDumper
impl Send for PtraceDumper
impl Sync for PtraceDumper
impl Unpin for PtraceDumper
impl UnwindSafe for PtraceDumper
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more