Back to Mruby

mruby-bin-debugger

mrbgems/mruby-bin-debugger/README.md

4.0.02.0 KB
Original Source

mruby-bin-debugger

mrdb is the mruby debugger for debugging Ruby scripts.

Usage

mrdb [switches] programfile

Options

  • -b - load and execute RiteBinary (mrb) file
  • -d - specify source directory
  • --version - print the version
  • --copyright - print the copyright

Debugger Commands

CommandAbbreviationDescription
breakbSet a breakpoint
continuecContinue execution
deletedDelete breakpoints
disabledisDisable breakpoints
enableenEnable breakpoints
evalevEvaluate expression
helphShow help
info breakpointsi bShow breakpoint information
info localsi lShow local variables
listlList source code
printpPrint expression value
quitqQuit debugger
runrRun program
stepsStep into
nextnStep over

Examples

bash
# Start debugging a script
mrdb script.rb

# Debug a compiled binary with source directory
mrdb -b -d /path/to/source script.mrb

Debugging Session Example

$ mrdb script.rb
(mrdb) b 10           # Set breakpoint at line 10
(mrdb) r              # Run the program
(mrdb) p variable     # Print variable value
(mrdb) n              # Step to next line
(mrdb) i l            # Show local variables
(mrdb) c              # Continue execution
(mrdb) q              # Quit

License

MIT License - see the mruby LICENSE file.