diff options
author | xd009642 <danielmckenna93@gmail.com> | 2018-01-31 20:33:31 +0000 |
---|---|---|
committer | xd009642 <danielmckenna93@gmail.com> | 2018-01-31 20:33:31 +0000 |
commit | b218cd5e9ccb63524e9a9a687f48772b826b4907 (patch) | |
tree | 767cf4367779f4f90242ca568f31ac59a99ad3bc | |
parent | 254849621d36b1404f9b393f74f040a912bc6909 (diff) | |
download | nix-b218cd5e9ccb63524e9a9a687f48772b826b4907.zip |
Added example and updated changelog.
Added doc test for sys::ptrace::step and also updated the changelog.
-rw-r--r-- | CHANGELOG.md | 2 | ||||
-rw-r--r-- | src/sys/ptrace.rs | 13 |
2 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index dbe6110a..ffc1b560 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [0.10.0] 2018-01-26 ### Added +- Added specialized wrapper: `sys::ptrace::step` + ([#852](https://github.com/nix-rust/nix/pull/852)) - Added `AioCb::from_ptr` and `AioCb::from_mut_ptr` ([#820](https://github.com/nix-rust/nix/pull/820)) - Added specialized wrappers: `sys::ptrace::{traceme, syscall, cont, attach}`. Using the matching routines diff --git a/src/sys/ptrace.rs b/src/sys/ptrace.rs index 22c6f487..ae371b50 100644 --- a/src/sys/ptrace.rs +++ b/src/sys/ptrace.rs @@ -285,6 +285,19 @@ pub fn cont<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { /// /// Advances the execution of the process with PID `pid` by a single step optionally delivering a /// single specified by `sig`. +/// +/// # Example +/// ```rust +/// extern crate nix; +/// use nix::sys::ptrace::step; +/// use nix::unistd::Pid; +/// use nix::sys::signal::Signal; +/// fn main() { +/// let dummy_pid = Pid::from_raw(0); +/// +/// let _ = step(dummy_pid, Some(Signal::SIGSTOP)); +/// } +/// ``` pub fn step<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> { let data = match sig.into() { Some(s) => s as i32 as *mut c_void, |