Here are a few tips on how to make rdebug a lot more useful in just a few minutes.
These settings live in your
~/.rdebug file. As with all other configuration
files, I recommend keeping this under version control.
set listsize 40
By default rdebug only shows a few lines before and after the line at which your program is currently paused. This setting increases the list size to 40 lines, providing a lot more context.
When stepping through the code, do a ‘list’ command (that is, print
lines around the current line) after each step. When quickly stepping over
several lines, this almost resembles using a debugger in an IDE where a marker
moves over the lines as they are executed.
Automatically evaluate any unrecognized command as Ruby code. Slightly confusing if you use short variable names in your debug sessions, because they’ll sometimes collide with the debugger command aliases (for example ‘s’).
Reload source files whenever a change has been detected. Not sure how effective this is in Rails projects. If I make a source change I usually just ‘cont’ the debug session and then restart it. In a Rails project, the code will have been reloaded the next time I hit my breakpoint.
Force stepping to another source line. This fixes the annoying issue where you step on the same line several times because it contains multiple stopping points. You usually want to move to a different line when stepping and this setting ensures that you always do.