This post is part of my Writing a Debugger series. View all posts and upcoming topics → A few posts ago, we used ownership in Rust to drive the design of our API when setting multiple breakpoints in our rusty_trap debugger. Then we did some vibe coded further refactoring of the API. The API we have for inferiors and breakpoints now is pretty clean and we can move onto the next feature. This has…
In my last post I used ownership to drive the API design for multiple breakpoints , I ended up with an API for the inferiors that I wasn’t entirely happy with. I wrote Now, I say it’s clean meaning it compiled without any warnings. But I don’t really like the API, it doesn’t feel clean to me. For you rustaceans that have a better knowledge of idiomatic Rust than I do, what’s the right way to…
Welcome back to my series on writing a debugger in rust . In our previous post we updated our custom breakpoint handling to support multiple breakpoints in C. And in this post we will do the same thing in Rust. For reference I’m starting at commit a9447ec . But this is Rust and not C and we will follow Rust’s best practices which will guide us toward an implementation that eliminates global state…
Ring Theory When I was in college I studied computer science but I also took a lot of math classes including abstract math. My intro to abstract algebra went well and I enjoyed the class. I decided to take the next course which was on ring theory, if I remember correctly. The beginning of this class started off as sort of a shock, yes it got more abstract and harder to understand but our professor…
In a previous post I worked on getting Trap building on a new system and found that the unit tests were not passing. It looked like I had found a real bug: I found: The first call to breakpoint_resolve must be when the breakpoint in main is reached. And the second call is 3 bytes later. I think this is trying to resolve the stop in execution that happens when we are in state…
Wow—exactly 10 years ago, I launched this blog. And while it only lived for a few short months, the original intent still resonates. Today, I’m relaunching it with the same goals at heart: To explore the Rust programming language To demonstrate how to build low-level systems projects in C To investigate emerging tools and technologies To write long-form technical series And to occasionally dive…
In this post I want to describe one form of Systems Thinking that I apply in my work and honestly in many aspects of my life. This is what I call Question and Answer thinking. Whenever I start investigating an issue, solving a problem, or thinking about a new system to build I start by asking myself a question. I keep a notes document and I write this question down. Then, I take that question as a…
In my last post I came back to my debugger project and got set up to build it and tried to get the tests to pass. In this post I’m doing the same with the rust version, rusty_trap . I want to get in the habit of tracking where I’m starting these posts. So I’m at commit 6c22cba . When I try to compile I get a few errors: -*- mode: compilation; default-directory:…
It’s been a long time and I’m finally coming back to this project and need to get things building again. I tried compiling the project and ran into the following errors: -- Configuring done -- Generating done -- Build files have been written to: /home/jkain/projects/trap/_out Scanning dependencies of target trap [ 4%] Building C object src/CMakeFiles/trap.dir/inferior_load.c.o…
In the last post we implemented a state machine to manage breakpoints in rusty_trap. We also added support for hitting a single breakpoint multiple times. Now, I want to start adding support for multiple distinct breakpoints. One way to approach adding a new feature is to refactor to make the code easily accept the new feature. That’s what I set out to do today, but it didn’t go the way I planned.…