Ruby VM Debug Environment: Part 2

Overview In the last post, I setup a a container with a pre-built version of Ruby ready to debug. In this post, I’ll talk about how to pass it a ruby script and watch it execute. Debug the VM while it executes a script Continuing from last time, ensure you’re attached to the debug container and that you can set breakpoints and run the program. We want to create a simple_test.rb file that that we can pass into the interpreter with the following contents: ...

2021-11-23 · 3 min

Ruby VM Debug Environment: Part 1

Overview I’ve always wanted to learn more about how the Ruby interpreter works, and I figured a good way is to step through the code and see what it does. Join me as I figure out how to build the source and step through it using a debugger. We’re going to build a Docker image with a debug version of Ruby (i.e. non-optimized, with debug symbols) built and ready to run using VSCode. I picked the container approach because I think it offers a better developer experience, especially if you want to setup a one-off environment without changing anything on your local machine. ...

2021-11-20 · 4 min