rdebug(1)

NAME
rdebug - Fast Ruby debugger

SYNOPSIS
rdebug [debugger-options] rdebug [script-options...]

DESCRIPTION
This manual page documents briefly the rdebug command.

rdebug is a fast implementation of the standard Ruby debugger debug.rb. It is implemented by utilizing a Ruby C API hook, allows for remote debugging and can be used as the Ruby debugger backend interface for a development environment.

The commands generally follow gdb's command set unless there's good reason not to.

rdebug can do four main kinds of things (plus other things in support of these) to help you catch bugs in the act:

•   Start or restart your Ruby script, specifying arguments that might affect its behavior.

•   Make your program stop at various points possibly determined by specified conditions.

•   Examine what has happened when your program has stopped.

•   Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another.

Here are some of the most frequently-needed commands:

break [file:line|class.method] [if expr]
    Set a breakpoint at class.method or at the specified file and line.

continue [line]
    Continue running your program (after stopping, e.g. at a breakpoint). If a line is given a one-time breakpoint is set there.

delete [breakpoint-numbers]
    Delete breakpoints by number. If no number is given delete all breakpoints.

down [count]
    Move down one block frame. If count is given move up that many frames. A negative number goes the other direction and is like the up command

finish
    Run until the completion of the current function or method.

frame frame-number
    Set the stack frame to frame-number for purposes of examinine local variables. For positioning relative to the current frame, use up or down. A negative number starts counting from the other end.

help [name]
    Show information about rdebug command name , or general information about using rdebug.

info [name]
    Get the various information usually about the debugged program.

irb command
    Run an interactive ruby shell (irb) using the current environment.

list [file:line|function]
    type the text of the program in the vicinity of where it is presently stopped or at the specified function or file and line.

next [count]
    Execute next program line(s) (after stopping); step over any function calls in the line.

pp expr
    Pretty print the value of an expression.

print expr
    Display the value of an expression.

ps expr
    Print an array as a columized sorted list.

quit
    Exit from the debugger.

run [arglist]
    (Re)start your program (with arglist , if specified). If you want the debugger to get reloaded, use restart instead.

set Modify parts of the debugger environment.

show
    See the debugger environment settings

source filename
    Read and execute the lines in file filename as a series of debugger commands.

step [count]
    Execute next program line(s) (after stopping); step into any function calls in the line.

up [count]
    Move up one block frame. If count is given move up that many frames. A negative number goes the other direction and is like the down command

where [count]
    Display all or count items of the program stack.

For full details on rdebug, see https://github.com/cldwalker/debugger

OPTIONS

-A | --annotate LEVEL
    Set gdb-style annotation to LEVEL, a number. Additional information is output automatically when program state is changed. This can be used by front-ends such as GNU Emacs to post this updated information without having to poll for it.

--client
    Connect to a remote debugger. Used with another rdebug invocation using --server. See also --host and --cport options

--cport=PORT
    Port used for control commands.

-d | --debug
    Set $DEBUG true.

--emacs
    Activates full GNU Emacs mode. Is the equivalent of setting the options --emacs-basic, --annotate=3, --no-stop, --no-control and --post-mortem.

--emacs-basic
    Activates GNU Emacs mode. Debugger prompts are prefaced with two octal 032 characters.

-h | --host=HOST
    Host name used for remote debugging.

-I | --include PATH
    Add PATH to $LOAD_PATH

-m | --post-mortem
    Activate post-mortem mode.

--no-control
    Do not automatically start control thread.

--no-stop
    Do not stop when script is loaded.

-p | --port=PORT
    Host name used for remote debugging.

-r | --require SCRIPT
    Require the library, before executing your script.

--script FILE
    Name of the script file to run.

-x | --trace
    Show lines before executing them.

--no-quit
    Do not quit when script terminates. Instead rerun the program.

--version
    Show the version number and exit.

--verbose
    Turn on verbose mode.

--v Print the version number, then turn on verbose mode if a script name is given. If no script name is given just exit after printing the version number.

--nx
    Don't execute commands found in any initialization files, e.g. .rdebugrc.

--keep-frame-binding
    Keep frame bindings.

--script=FILE
    Name of the script file to run -s | --server Listen for remote connections. Another rdebug session accesses using the --client option. See also the --host, --port and --cport options

-w | --wait
    Wait for a client connection, implies -s option.

--help
    Show invocation help and exit.

SEE ALSO

https://github.com/cldwalker/debugger

AUTHOR
rdebug was written by Kent Siblev. This manual page was written by Rocky Bernstein <rocky@gnu.org>