-
Notifications
You must be signed in to change notification settings - Fork 673
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
nix::sys::ptrace desperately needs documentation #649
Comments
First of all, thanks for offering to contribute docs, unfortunately they're severely lacking for My first questions are what is your platform and what version of Looking at your examples, your code looks correct to me from what I understand about And your first issue, if we removed the external dependencies, would be a great match for our local test suite. I'd love to get this issue resolved to the point where we could get some |
Additionally, I'd also love to have safe functions for all the |
Yeah, I'll eagerly contribite the example to the testsuite. I'll try using the libc version tomorrow. To be sure - you mean this crate: https://github.com/rust-lang/libc Yeah, I wanted to say the same. I think I'd do them anyway, so why not contribute them here. But let's start small. I'll see if I can utilize libc::ptrace tomorrow |
@marmistrz Yes, that's the main |
What's the best way to add a git version as a dependency? cargo will only download from crates.io |
|
Hi, |
Oh, so there was a mistake on my side, that I did not exit the loop after the process has exited :P So, Btw. what's the difference between Do we want to include something similar to EDIT: I've already created the register data for x64, would such a thing be ok to include into |
There isn't one. We just expose the version of
I don't know what it does, but probably not. We're trying to be a thin and safe wrapper over
Yes, but you shouldn't declare values directly in |
Oh, I didn't notice these types are exported vla the libc crate. But the approach that the end user (i.e. the programmer) only uses |
We shouldn't do any "translation", as the enum values should be the proper numeric values to start. So you'll want to write the enum like: pub enum Register {
R15 = libc::R15,
R14 = libc::R14,
R13 = libc::R13,
...
} But I searched through the |
Because they're here: https://doc.rust-lang.org/regex/libc/struct.user_regs_struct.html I didn't know Rust's enums are so clever. And is it possible to do something like this:
which would be equivalent to your snippet? I'll contribute that on Monday, besides I already have 3 clean wrappers around |
No that syntax won't work. But looking forward to a PR with your contributions! |
As for the registry of syscalls: raised that in |
Hi!
First of all - I'm eager to contribute the documentation, once I've understood, how the module should be used.
I was quite new to
ptrace
and I'm still learning, so I might have missed something obvious, keep this in mind please :)I had this small piece of code, which simply printed a message, whenever a syscall was entered or exited.
This worked very well. Now I translated this into Rust.
No good. Nothing displays, the process is stuck at the
wait()
forever.I took a look at the
spawn-ptrace
crate, which doesn't callwait()
before, so next try:This displays all syscalls, compared to the C version, but panicks at the end, because the process is not in the stopped state.
Could anyone explain, how the
nix::sys::ptrace
module should be used? I'll be happy to contribute the documentation in return.The text was updated successfully, but these errors were encountered: