Building a Debugger from Scratch in Rust to Learn Core Concepts
Writing a Debugger from Scratch
I am building a new debugger in Rust to deepen my understanding of the language and simplify how others learn debugging mechanics. By leveraging Rust's ecosystem, we can focus on core concepts rather than low-level details. This first part covers attaching to a process on Windows using basic APIs, setting up an event loop to monitor debug events, and allowing the target process to resume execution.
I've left the Microsoft Debugger Platform team twice, and each time I've started writing my own debugger. I must really like debuggers or something.
- Cieric
I feel like it's good to note since I missed it. This post is from Feb 13, 2023. He has up to 8 posts on this at this point which don't appear to be linked to from this post. I think linking to all of them would be a bit much, but they're all currently listed on his main page [1].
- scott01
There’s a relevant book from No Starch, highly recommend. The author also has a series of blog posts on the topic.
- whartung
A favorite developing a debugger story was from a friend of mine.
They were working on a debugger for OS/2, which was quite notable at the time for being multitasking.
And at one point they got to enough of a base feature set that they could use the debugger on itself. Debugging the debugger.
While debugging the debugger, they would inevitably encounter other bugs in the debugging debugger.
So, with OS/2, they had a bit of an epiphany when they were able to debug the debugger debugging the debugger.