21 releases

0.4.13 Nov 17, 2023
0.4.12 Jun 8, 2023
0.4.11 Dec 5, 2022
0.4.10 Jul 29, 2022
0.1.0 Jul 7, 2019

#83 in Operating systems

Download history 266/week @ 2023-12-16 234/week @ 2023-12-23 311/week @ 2023-12-30 222/week @ 2024-01-06 367/week @ 2024-01-13 281/week @ 2024-01-20 387/week @ 2024-01-27 293/week @ 2024-02-03 268/week @ 2024-02-10 360/week @ 2024-02-17 579/week @ 2024-02-24 362/week @ 2024-03-02 268/week @ 2024-03-09 313/week @ 2024-03-16 344/week @ 2024-03-23 442/week @ 2024-03-30

1,410 downloads per month
Used in 12 crates (8 directly)

MIT license

7.5K SLoC


Build Status FreeBSD Build Status

This crate provides a cross platform way of querying information about other processes running on the system. This let's you build profiling and debugging tools.


  • Suspending the execution of the process
  • Getting the process executable name and current working directory
  • Get the command line of the process
  • Listing all the threads in the process
  • Get all the child processes of the process
  • Figure out if a thread is active or not
  • Read memory from the other processes (using read_proceses_memory crate)

By enabling the unwind feature you can also:

  • Get a stack trace for a thread in the target process
  • Resolve symbols for an address in the other process

This crate provides implementations for Linux, OSX, FreeBSD and Windows


To show a stack trace from each thread in a program

fn get_backtrace(pid: remoteprocess::Pid) -> Result<(), remoteprocess::Error> {
    // Create a new handle to the process
    let process = remoteprocess::Process::new(pid)?;

    // lock the process to get a consistent snapshot. Unwinding will fail otherwise
    let _lock = process.lock()?;

    // Create a stack unwind object, and use it to get the stack for each thread
    let unwinder = process.unwinder()?;
    for thread in process.threads()?.iter() {
        println!("Thread {}", thread);

        // Iterate over the callstack for the current thread
        for ip in unwinder.cursor(thread)? {
            let ip = ip?;

            // Lookup the current stack frame containing a filename/function/linenumber etc
            // for the current address
            unwinder.symbolicate(ip, &mut |sf| {
                println!("{}", sf);

A complete program with this code can be found in the examples folder.


Currently we only have implementations for getting stack traces on some platforms:

Linux Windows OSX FreeBSD
x86-64 yes yes
ARM yes


This crate heavily relies on the gimli project. Gimli is an amazing tool for parsing DWARF debugging information, and we are using it here for looking up filename and line numbers given an instruction pointer.


~156K SLoC