Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP support #1300

Merged
merged 1 commit into from
Oct 3, 2020

Conversation

voidc
Copy link
Contributor

@voidc voidc commented Sep 28, 2020

Closes #1249.
I think @jabedude was working on this, but as there was no progress since May I went ahead and implemented it myself.
I'm not completely sure about the cfg gates. Could we enable the functions for more targets?
I'm also open for suggestions of better names for the new functions.

@jabedude
Copy link
Contributor

thanks @voidc, got busy with work and this dropped off my plate :)

/// In case the tracee is stopped at a syscall, the syscall will not be executed.
/// Optionally, the signal specified by `sig` is delivered to the tracee upon continuation.
#[cfg(all(target_os = "linux", target_env = "gnu", any(target_arch = "x86", target_arch = "x86_64")))]
pub fn step_or_sysemu<T: Into<Option<Signal>>>(pid: Pid, sig: T) -> Result<()> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about fn sysemu_singlestep?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I renamed it to sysemu_step to be in line with the naming of the step method.

@voidc
Copy link
Contributor Author

voidc commented Oct 3, 2020

I rebased. Could anybody review?

Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors r+

@bors
Copy link
Contributor

bors bot commented Oct 3, 2020

Build succeeded:

@bors bors bot merged commit 7ed2820 into nix-rust:master Oct 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ptrace PTRACE_SYSEMU request
3 participants