Headcrab: July 2020 progress report
About 3 weeks ago, we started a new project to create a new modular and composable debugger library for Rust, taking inspiration from projects such as Delve and MDB. In less than 4 weeks, we have already seen some exciting progress!
We have started with the basics: launching debuggee processes, reading & writing memory, reading & writing CPU registers, and reading debug symbols – doing these right is an essential prerequisite before progressing towards more complex features such as breakpoints. And there’s a lot of hidden complexity in these functions, as every target platform has its own quirks and requires a separate implementation. Providing a unified, simple API to hide these quirks from a user is one of our goals for the phase 1.
Overall, there were 32 pull requests adding the following features:
- #57 added a simple REPL/command line example (the one you see on the screen shot above!), and #58 added some more commands.
- #22, #29, #32, #33, #49 added new abstractions & tests for reading debuggee’s memory.
- #52 implemented a
ptracefallback for reading protected memory on Linux.
- #40 added support for reading registers from a target process on Linux.
- #62 implements a kill-on-exit function to make sure that processes started by the debugger don’t linger on in the suspended state.
- #59 added support for debugging position-independent executables.
- #56 implemented helper functions to perform system calls in the context of a debuggee on Linux.
- #47 added new functions to get a list of threads from a debuggee process.
- #43 implemented the attach function to debug already running processes.
- #6 implemented the basic debugger functions for the macOS target.
- #12 started, and #46 significantly improved implementation for reading DWARF debug symbols.
- #15, #19, #25 added more documentation & guides for new contributors.
- #2, #5, #14, #24, #23, #27, #45, and #28 set up the build automation & continuous integration on Linux, macOS, and FreeBSD.
- #3 implemented functions to launch a new debuggee process.
Here’s a glimpse of what we’ll be working on in the near term:
- Stack unwinding and backtraces. The implementation is already started with the pull request #61.
- Disassembling code. This is already started by bjorn3 in #54 and currently it’s blocked by a dependency issue.
- Setting breakpoints and catching events, crashes, and signals occuring in a debuggee process.
- As not all of the functions listed above are implemented for macOS, there’s a lot of catching up to do.
- Reading & writing thread-local variables.
If you want to help, you can join us in our Zulip chat. We welcome first-time contributors!
You can also support our work on OpenCollective.
This month’s contributors were:
- Atul Bhosale
- Egor Kovetskiy
- Fábio Botelho
- Harikrishnan Menon
- Jakub Jendryka
- Nikita Baksalyar
OpenCollective backers and GitHub sponsors:
- Max Filippov
- Sean Wilson
- Serhiy Martynenko
- Viktor Bakurin
Thank you for your support!
For future updates, please subscribe to the RSS feed or to our email newsletter: