17 releases (11 breaking)

0.12.0 Sep 5, 2023
0.10.0 Apr 20, 2023
0.9.0 Aug 20, 2022
0.8.0 Sep 30, 2021
0.2.1 May 29, 2020

#457 in Unix APIs

Download history 1/week @ 2023-12-28 19/week @ 2024-01-25 3123/week @ 2024-02-01 4945/week @ 2024-02-08 2087/week @ 2024-02-15 2099/week @ 2024-02-22 1878/week @ 2024-02-29 1143/week @ 2024-03-07 829/week @ 2024-03-14 331/week @ 2024-03-21 118/week @ 2024-03-28

2,667 downloads per month
Used in 5 crates (3 directly)

ISC license

40KB
652 lines

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.

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.

Dependencies

~2.5MB
~53K SLoC