Ruby Debugger
Usage:
ruby -rdebug filename[, ...]Commands:
b[reak] [file:|class:](line|method)b[reak] [class.](line|method)Sets breakpoint to some position.
wat[ch]expressionSets watchpoint to some expression.
cat[ch] (exception|off)Sets catchpoint to an exception.
b[reak]Lists breakpoints.
cat[ch]Shows catchpoint.
del[ete][nnn]Deletes some or all breakpoints.
disp[lay]expressionAdds expression into display expression list.
undisp[lay][nnn]Deletes one particular or all display expressions.
c[ont]Runs until program ends or hits breakpoint.
s[tep]nnnSteps (into methods) one line or until line
nnn.n[ext]nnnGoes over one line or until line
nnn.w[here]Displays frames.
f[rame]Alias for
where.l[ist][ (-|nn-mm)Lists program,
-lists backward.nn-mmLists given lines.
up[nn]Move to higher frame.
down[nn]Moves to lower frame.
fin[ish]Returns to outer frame.
tr[ace] (on|off)Sets trace mode of current thread.
tr[ace] (on|off) allSets trace mode of all threads.
q[uit]Exits from debugger.
v[ar] g[lobal]Shows global variables.
v[ar] l[ocal]Shows local variables.
v[ar] i[nstance]objectShows instance variables of
object.v[ar] c[onst]objectShows constants of
object.m[ethod] i[nstance]objectShows methods of
object.m[ethod] (class|module)Shows instance methods of
classormodule.th[read] l[ist]Lists all threads.
th[read] c[ur[rent]]Shows current thread.
th[read] [sw[itch]]nnnSwitches thread context to
nnn.th[read] stopnnnStops thread
nnn.th[read] resumennnResumes thread
nnn.pexpressionEvaluates
expressionand print ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access