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

Added ptrace::{getregs, setregs} #1010

Merged
merged 1 commit into from
Jan 10, 2019
Merged

Added ptrace::{getregs, setregs} #1010

merged 1 commit into from
Jan 10, 2019

Conversation

wpovell
Copy link
Contributor

@wpovell wpovell commented Jan 9, 2019

I needed ptrace's getregs and setregs for a project I was working on, so I added them! First time contributor, so let me know if I should change / fix anything. Things work fine in my project which uses both functions, let me know if further testing is needed.

@wpovell
Copy link
Contributor Author

wpovell commented Jan 10, 2019

Not entirely sure why CI is failing; it seems like user_regs_struct can't be found on some platforms, even when wrapping the use with the same cfg used by PTRACE_GETREGS

@asomers
Copy link
Member

asomers commented Jan 10, 2019

Should be easy to debug. Just checkout the libc repository and have a look. It's also possible that the libc repository has errors. If you find one, just send libc a PR.

@wpovell
Copy link
Contributor Author

wpovell commented Jan 10, 2019

@asomers CI is passing now. I enabled the calls on only Linux x86_64 and x86 GNU since the struct isn't defined for any other target. In the future I might look into seeing if I can get something similar for other targets, but they're not ones I use myself so I'm a bit hesitant to go mucking around in libc.

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.

Ordinarily we would insist on a test. But it's pretty difficult to come up with a meaningful test for most ptrace operations.

bors r+

bors bot added a commit that referenced this pull request Jan 10, 2019
1010: Added `ptrace::{getregs, setregs}` r=asomers a=wpovell

I needed `ptrace`'s `getregs` and `setregs` for a project I was working on, so I added them! First time contributor, so let me know if I should change / fix anything. Things work fine in my project which uses both functions, let me know if further testing is needed.

Co-authored-by: Will Povell <william_povell@brown.edu>
@bors
Copy link
Contributor

bors bot commented Jan 10, 2019

Build succeeded

@bors bors bot merged commit 2a437bf into nix-rust:master Jan 10, 2019
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.

None yet

2 participants