The whole of my book on Building a Debugger is now available on Early Access!
It teaches you how to write a native code debugger from scratch.
There's lots of cats.
If you've already worked through the chapters of the first Early Access version, I've written a handy upgrade guide that shows you all the code changes you need to make to get up-to-date: https://github.com/TartanLlama/sdb/blob/main/early_access_upgrade.md
@TartanLlama I have some students who are interested in building a time travel debugger, am pointing them to your book for base knowledge!
@va2lam great! There's a small bit at the end about time travel debugging, but I don't cover it in detail
@TartanLlama Looks amazing! Will I be able to follow this on an ARM + macOS system?
@eh I've heard a couple people doing this with UTM emulation, but haven't heard back about completing the whole thing, it's on my checklist before full release.
If you felt like building the sample codebase and running the tests to see if they all pass on your system, that would mean that everything in the book should work fine: https://github.com/TartanLlama/sdb/tree/main
If it works, please do let me know!
Some things in the book I think are cool:
- Walks you through implementing limited expression evaluation, so you can call functions inside the running process
- Teaches you to write a DWARF parser
- Builds a full stack unwinder based on DWARF unwind tables
- Traces shlib loading
@orphadel intermediate and above I'd say. I try to keep things accessible, but some of the concepts are intrinsically complex
@TartanLlama Should I know C++ before reading the book? I've worked as a software developer for 15 years, but mostly Python, JavaScript and a bit of Rust.
@natarasee having some C++ is ideal, but you may be able to muddle through with your Rust knowledge. I try to explain any of the more advanced C++ features I use
@TartanLlama Rust has given me an understanding of general static language concerns, e.g. you need to know the size of a type at compile time. But there might be some C++ specifics (templates?) I'll need to lookup, I guess.
@natarasee yeah, I use templates in a couple places, but I try to explain the uses in detail