Skip to content
Sign UpLog In

ruby/debug demo

st0012
st0012
Made with
Ruby
Ruby
Published on May 6, 2022
  • #debugging
  • #ruby

(expand 👇)

This repl helps you learn the basic commands of the Ruby debugger.
Once you start the repl, it should stop at a breakpoint. Play around with commands like:

  • bt to see all the backtraces with rich information like call arguments
  • ls to see what methods are available to the current Foo instance
  • info to see variables accessible to the current scope and preview their values
  • <expr> or p <expr> or pp <expr> to evaluate and print a Ruby expression

Once you're comfortable with the debugger console, you can then move around inside the program with:

  • s[tep] to step to the next breakable point
  • n[ext] to step to the next line
  • c[ontinue] to resume the program execution
  • up to move up a frame
  • down to move down a frame
  • f[rame] <id> to move to a specific frame
    • You can use bt command to see all available frames

(Full list of commands)

Total Tips
0
Loading comments...