https://github.com/ranweiler/pete
A friendly wrapper around ptrace(2)
https://github.com/ranweiler/pete
debugging linux ptrace
Last synced: about 1 year ago
JSON representation
A friendly wrapper around ptrace(2)
- Host: GitHub
- URL: https://github.com/ranweiler/pete
- Owner: ranweiler
- License: isc
- Created: 2020-05-17T01:51:33.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-11-11T08:15:17.000Z (over 1 year ago)
- Last Synced: 2025-03-31T16:15:59.049Z (over 1 year ago)
- Topics: debugging, linux, ptrace
- Language: Rust
- Homepage:
- Size: 90.8 KB
- Stars: 17
- Watchers: 2
- Forks: 10
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Pete
A friendly wrapper around the Linux `ptrace(2)` syscall.
## Requirements
The current minimum supported OS and compiler versions are:
- Linux 4.8
- rustc 1.64
Continuous testing is only run for `x86_64-unknown-linux-gnu`.
Support for earlier Linux versions is possible, but low priority. Eventually, we would
like to support any platform that provides `ptrace(2)`.
## Summary
The `ptrace(2)` interface entails interpreting a series of `wait(2)` statuses. The context used to
interpret a status includes the attach options set on each tracee, previously-seen stops, recent
ptrace requests, and in some cases, extra event data that must be queried using additional ptrace
calls.
Pete is meant to instead permit reasoning directly about ptrace-stops, as described in the manual.
We hide the lowest-level contextual bookkeeping required to disambiguate ptrace-stops. Whenever we
can, we avoid extraneous ptrace calls, deferring to downstream tracers implemented on top of the
library. For example, Pete can distinguish a syscall-enter-stop and syscall-exit-stop, but does not
_automatically_ query register state to identify the specific syscall.
## License
Pete is licensed under the [ISC License](./LICENSE).
## Contributing
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in
`pete` by you, shall be licensed as ISC, without any additional terms or conditions.