[][src]Struct ptracer::Ptracer

pub struct Ptracer { /* fields omitted */ }

Ptrace wraps ptrace syscalls to enable writing an debugger.

WARNING: Only one concurrent instance is currently supported!

Implementations

impl Ptracer[src]

pub fn spawn(path: &Path, args: &[String]) -> Result<Self>[src]

Spawn a new debugee.

Set ptrace options for exec/fork/exit variants.
Disable ASLR (linux only).

WARNING: Only one concurrent instance is currently supported!

pub fn insert_breakpoint(&mut self, address: usize) -> Result<()>[src]

Insert a new breakpoint.

If breakpoint exists, do nothing.

pub fn enable_breakpoint(&mut self, address: usize) -> Result<()>[src]

Enable a breakpoint.

If breakpoint does not exists, do nothing.
If breakpoint is enabled, do nothing.

pub fn disable_breakpoint(&mut self, address: usize) -> Result<()>[src]

Disable a breakpoint.

If breakpoint does not exists, do nothing.
If breakpoint is disabled, do nothing.

pub fn remove_breakpoint(&mut self, address: usize) -> Result<()>[src]

Remove a breakpoint.

If breakpoint does not exists, do nothing.

pub fn cont(&mut self, how: ContinueMode) -> Result<()>[src]

Continue debugee, see cont_aux for details.

pub fn step(&mut self, how: ContinueMode) -> Result<()>[src]

Singlestep debugee, see cont_aux for details.

pub fn syscall(&mut self, how: ContinueMode) -> Result<()>[src]

Run until syscall, see cont_aux for details.

pub fn detach(&self, signal: Option<Signal>) -> Result<()>[src]

Detach from debugee.

All breakpoints are removed before detach.

pub fn pid(&self) -> Pid[src]

Return the debugee pid.

pub fn registers(&self) -> &PtraceRegisters[src]

Return the latest register state.

pub fn threads(&self) -> &HashMap<Pid, ThreadState>[src]

Return the debugee threads.

pub fn event(&self) -> &WaitStatus[src]

Return the latest event.

pub fn breakpoints(&self) -> &HashMap<AddressType, Breakpoint>[src]

Return all breakpoints.

Trait Implementations

impl Debug for Ptracer[src]

Auto Trait Implementations

impl RefUnwindSafe for Ptracer

impl !Send for Ptracer

impl !Sync for Ptracer

impl Unpin for Ptracer

impl UnwindSafe for Ptracer

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, 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.