Skip to content

Commit

Permalink
Add default options accessors (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranweiler committed Sep 4, 2023
1 parent e8e9a35 commit 0a7e800
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Add accessors for the default options applied to newly-spawned tracees

### Changed

- Update MSRV to 1.64
Expand Down
10 changes: 10 additions & 0 deletions src/ptracer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,16 @@ impl Ptracer {
Self { options, tracees }
}

/// Returns a reference to the default ptrace options applied to newly-spawned tracees.
pub fn default_options(&self) -> &Options {
&self.options
}

/// Returns a mutable reference to the default ptrace options applied to newly-spawned tracees.
pub fn default_options_mut(&mut self) -> &mut Options {
&mut self.options
}

/// Resume the stopped tracee, delivering any pending signal.
pub fn restart(&mut self, tracee: Tracee, restart: Restart) -> Result<()> {
let Tracee { pid, pending, .. } = tracee;
Expand Down

0 comments on commit 0a7e800

Please sign in to comment.