Ruby bytecode debugger

259 Views Asked by At

I have been able to extract the YARV bytecode list of instructions from a "compiled" ruby file using RubyVM::InstructionSequence#disassemble.

Now I would like to debug the code instruction by instruction.

Is there any debugger that let me do that?

Regards

1

There are 1 best solutions below

0
On

I don't know of any Ruby level debuggers that will allow instruction by instruction debugging. However, as Ruby is written in C, you could use GDB.

The core interpreter loop which processes those instructions is implemented in vm_exec_core. The bodies of the instructions are stored in insns.def, and processed into C code, stored in vm.inc.