summaryrefslogtreecommitdiff
path: root/src/sys/ptrace
AgeCommit message (Collapse)Author
2023-05-21Merge #2009bors[bot]
2009: Add more detail for ptrace documentation r=asomers a=thomasqueirozb All functions are documented with the equivalent C call example except for `read`, `read_user`, `write` & `write_user`. I was looking for the function that used `PTRACE_PEEKDATA` and couldn't find it using the documentation and had to go to the source code to find it out. In hindsight, it's pretty obvious that it was read... But still I think it would be nice to have it documented Co-authored-by: Thomas de Queiroz Barros <38295417+thomasqueirozb@users.noreply.github.com>
2023-04-16Quiet a clippy::suspicious_doc_comments lintAlan Somers
2023-03-06Add more detail for ptrace documentationThomas de Queiroz Barros
2022-11-06Reformat everythingAlex Saveau
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-05-15Add ptrace::read_user and ptrace::write_userNikita Baksalyar
2022-01-24uclibc supportJonah Petri
2022-01-22Suppress clippy::not_unsafe_ptr_arg_deref warnings in ptrace on BSDAlan Somers
Technically these functions don't violate Rust's safety rules, because libc::ptrace doesn't dereference those pointer args. Instead, it passes them directly to the kernel.
2021-12-20feature-gate most Nix functionsVincent Dagonneau
Using features reduces build time and size for consumer crates. By default all features are enabled.
2021-09-19Clippy cleanupAlan Somers
And this time, start running Clippy in CI
2021-08-18Add `PTRACE_EVENT_STOP` enum variantGabriel Majeri
2021-08-09Add PTRACE_INTERRUPTMika Vatanen
2021-07-24Mark most C-derived enums as non_exhaustiveAlan Somers
Since libc may add new variants at any time, Nix's consumers should not use exhaustive match patterns. Fixes #1182
2021-07-07Collapse Error into ErrnoAlan Somers
Now that Nix's weird error types are eliminated, there's no reason not to simply use Errno as the Error type.
2021-07-07Overhaul Nix's error typesAlan Somers
For many of Nix's consumers it be convenient to easily convert a Nix error into a std::io::Error. That's currently not possible because of the InvalidPath, InvalidUtf8, and UnsupportedOperation types that have no equivalent in std::io::Error. However, very few of Nix's public APIs actually return those unusual errors. So a more useful API would be for Nix's standard error type to implement Into<std::io::Error>. This commit makes Error a simple NewType around Errno. For most functions it's a drop-in replacement. There are only three exceptions: * clearenv now returns a bespoke error type. It was the only Nix function whose error couldn't be cleanly mapped onto an Errno. * sys::signal::signal now returns Error(Errno::ENOTSUP) instead of Error::UnsupportedOperation when the user passes an incompatible argument to `handler`. * When a NixPath exceeds PATH_MAX, it will now return Error(Errno::ENAMETOOLONG) instead of Error::InvalidPath. In the latter two cases there is now some abiguity about whether the error code was generated by Nix or by the OS. But I think the ambiguity is worth it for the sake of being able to implement Into<io::Error>. This commit also introduces Error::Sys() as a migration aid. Previously that as an enum variant. Now it's a function, but it will work in many of the same contexts as the original. Fixes #1155
2021-05-30misc Clippy cleanupAlan Somers
* Fix race conditions in the tests. Two tests were grabbing a mutex but immediately dropping it. Thank you, Clippy. * Remove vestigial Windows support. Remove some code added to support Windows in 2015. Nix is no longer intended to ever run on Windows. * Various other minor Clippy lints.
2020-10-03Add PTRACE_SYSEMU and PTRACE_SYSEMU_SINGLESTEP supportDominik Stolz
2020-06-04Remove several deprecated constants and functionsAlan Somers
* `unistd::daemon` on Apple * `unistd::pipe2` on Apple * `sys::event::FilterFlag::NOTE_EXIT_REPARENTED` on Apple * `sys::event::FilterFlag::NOTE_REAP` on Apple * `sys::ptrace::ptrace` on Android and Linux All have been deprecated for more than two releases and one year.
2020-05-31Convert the crate to edition 2018Alan Somers
2020-05-16Make ptrace::write unsafe on LinuxAlan Somers
It always should've been unsafe, because it dereferences a user-provided pointer.
2020-04-25Fix RISC-V supportAndreas Schwab
Don't try to use PTRACE_[GS]ETREGS, PTRACE_[GS]ETFPREGS or PTRACE_[GS]ETFPXREGS on riscv64, they are legacy-only.
2020-04-02Enable getregs/setregs on muslcoord.e
Update CHANGELOG for #1198
2020-01-12Add RISC-V support on GNU/Linuxmsizanoen1
2019-12-01Allow signal injection in ptrace::{syscall, detach}Francisco Giordano
2019-11-17ptrace: add ptrace::seize for LinuxJeremy Fitzhardinge
2019-09-03Replace most instances of mem::uninitialized with mem::MaybeUninitAlan Somers
Only two instances remain: * For the deprecated sys::socket::CmsgSpace::new. We should probably just remove that method. * For sys::termios::Termios::default_uninit. This will require some more thought. Fixes #1096
2019-05-17Fix build on arm and s390x after recent libc changesAlan Somers
libc just removed some symbols on linux/arm32 and linux/s390x that never should've been defined in the first place. https://github.com/rust-lang/libc/commit/24f8972b8d2d915b1687fc8197e1ed95e349a82e https://github.com/rust-lang/libc/commit/d2695436ba5072078796c76f727a296e0f43caa6
2019-01-09Added ptrace getregs and setregsWill Povell
2018-12-01Correct architecture checkBryant Mairs
2018-11-28Prefer `map(drop)` to `map(|_| ())`Alan Somers
I previously advocated for the latter syntax on stylistic grounds. But it generates less efficient code, because it creates a new lambda function for each usage. The optimizer does not combine them. This change saves about 6KB of code.
2018-10-28Removed Peek and poke user from unsupportedOpxd009642
2018-10-24Added AddressType typexd009642
This was added to the BSD ptrace API and probably should have been added to tyhe linux API to make it easier to write code for both platforms without the user having to reexport the types to their own crate.
2018-10-21Added ptrace support for BSDsxd009642
* Moved ptrace API into it's own module with cfg'ed modules exported for linux/android or BSDs. * Replicated current linux API for BSD * Added API functions to peek and poke memory to avoid needing to replicate deprecated linux API and remaining feature complete * Added helper function for `PTRACE_KILL` requests * Updated tests based on new API changes * Added addition kill calls to `test_ptrace_cont` as inferior death doesn't happen immediately on OSX which caused issues in the tests.