Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 242 lines (235 sloc) 6.191 kb
0768eb0 @mark-moseley SVN RubyForge pull
mark-moseley authored
1 .\" $Id: rdebug.1 516 2007-12-31 05:55:24Z rockyb $
2 .TH rdebug 1
3 .SH NAME
4 rdebug \- Fast Ruby debugger
5 .SH SYNOPSIS
6 .B rdebug
7 [debugger-options]
8 rdebug
9 [script-options...]
10 .SH "DESCRIPTION"
11 This manual page documents briefly the
12 .BR rdebug
13 command.
14 .PP
15 .B rdebug
16 is a fast implementation of the standard Ruby debugger debug.rb. It
17 is implemented by utilizing a Ruby C API hook, allows for remote
18 debugging and can be used as the Ruby debugger backend interface for a
19 development environment.
20 .PP
21 The commands generally follow gdb's command set unless there's good
22 reason not to.
23
24 .PP
25 rdebug can do four main kinds of things (plus other things in support of
26 these) to help you catch bugs in the act:
27
28 .TP
29 \ \ \ \(bu
30 Start or restart your Ruby script, specifying arguments that might
31 affect its behavior.
32
33 .TP
34 \ \ \ \(bu
35 Make your program stop at various points possibly determined by
36 specified conditions.
37
38 .TP
39 \ \ \ \(bu
40 Examine what has happened when your program has stopped.
41
42 .TP
43 \ \ \ \(bu
44 Change things in your program, so you can experiment with correcting the
45 effects of one bug and go on to learn about another.
46 .PP
47
48 Here are some of the most frequently-needed commands:
49 .TP
50 .B break \fR[\|\fIfile\fB:\fIline\fR\fR|\fIclass.method\fR] \fR[if \fIexpr\fR]
51 \&
52 Set a breakpoint at \c
53 .I class.method\c
54 \& or at the specified file and line.
55 .TP
56 .B continue \fR[\fIline\fR]
57 Continue running your program (after stopping, e.g. at a
58 breakpoint). If a line is given a one-time breakpoint is set there.
59 .TP
60 .B delete \fR[\fIbreakpoint-numbers\fR]
61 \&
62 Delete breakpoints by number. If no number is given delete all breakpoints.
63 .TP
64 .B down \fR[\|\fIcount\fR\|]
65 Move down one block frame. If count is given move up that many frames. A negative number
66 goes the other direction and is like the up command
67 .TP
68 .B finish
69 Run until the completion of the current function or method.
70 .TP
71 .BI frame " frame-number"
72 Set the stack frame to \fIframe-number\fR for purposes of examinine local variables. For positioning relative to the current frame, use
73 .B up
74 or
75 .B down. A negative number starts counting from the other end.
76 .TP
77 .B help \fR[\|\fIname\fR\|]
78 Show information about rdebug command \c
79 .I name\c
80 \&, or general information
81 about using rdebug.
82 .TP
83 .B info \fR[\|\fIname\fR\|]
84 Get the various information usually about the debugged program.
85 .TP
86 .B irb \fIcommand\fR
87 Run an interactive ruby shell (irb) using the current environment.
88 .TP
89 .B list \fR[\|\fIfile\fB:\fIline\fR|\fIfunction]
90 type the text of the program in the vicinity of where it is presently stopped
91 or at the specified function or file and line.
92 .TP
93 .B next \fR[\|\fIcount\fR\|]
94 Execute next program line(s) (after stopping); step \c
95 .I over\c
96 \& any
97 function calls in the line.
98 .TP
99 .BI pp " expr"\c
100 \&
101 Pretty print the value of an expression.
102 .TP
103 .BI print " expr"\c
104 \&
105 Display the value of an expression.
106 .TP
107 .BI ps " expr"\c
108 \&
109 Print an array as a columized sorted list.
110 .TP
111 .B quit
112 Exit from the debugger.
113 .TP
114 .B run \fR[\|\fIarglist\fR\|]
115 (Re)start your program (with \c
116 .I arglist\c
117 \&, if specified). If you want the debugger to get reloaded, use
118 .B restart
119 instead.
120 .TP
121 .B set
122 Modify parts of the debugger environment.
123 .TP
124 .B show
125 See the debugger environment settings
126 .TP
127 .BI source " filename"\c
128 \&
129 Read and execute the lines in file \fIfilename\fR as a series of debugger
130 commands.
131 .TP
132 .B step \fR[\|\fIcount\fR\|]
133 Execute next program line(s) (after stopping); step \c
134 .I into\c
135 \& any
136 function calls in the line.
137 .TP
138 .B up \fR[\|\fIcount\fR\|]
139 Move up one block frame. If count is given move up that many frames. A negative number
140 goes the other direction and is like the down command
141 .TP
142 .B where \fR[\|\fIcount\fR\|]
143 Display all or \fIcount\fR items of the program stack.
144 .PP
145 For full details on rdebug, see \c
146 http://rubyforge.org/projects/ruby-debug/
147 .SH OPTIONS
148 .PP
149 .TP 10
150 .TP
151 .B \-A | \-\-annotate LEVEL
152 Set gdb-style annotation to LEVEL, a number. Additional information is output
153 automatically when program state is changed. This can be used by
154 front-ends such as GNU Emacs to post this updated information without
155 having to poll for it.
156 .TP
157 .B \-\-client
158 Connect to a remote debugger. Used with another rdebug invocation using \-\-server.
159 See also \-\-host and \-\-cport options
160 .TP
161 .B \-\-cport=PORT
162 Port used for control commands.
163 .TP
164 .B \-d | \-\-debug
165 Set $DEBUG true.
166 .TP
167 .B \-\-emacs
168 Activates full GNU Emacs mode. Is the equivalent of setting the
169 options \-\-emacs\-basic, \-\-annotate=3, \-\-no-stop, \-\-no\-control
170 and \-\-post\-mortem.
171 .TP
172 .B \-\-emacs-basic
173 Activates GNU Emacs mode. Debugger prompts are prefaced with two octal
174 032 characters.
175 .TP
176 .B \-h | \-\-host=HOST
177 Host name used for remote debugging.
178 .TP
179 .B \-I | \-\-include PATH
180 Add PATH to $LOAD_PATH
181 .TP
182 .B \-m | \-\-post-mortem
183 Activate post-mortem mode.
184 .TP
185 .B \-\-no-control
186 Do not automatically start control thread.
187 .TP
188 .B \-\-no\-stop
189 Do not stop when script is loaded.
190 .TP
191 .B \-p | \-\-port=PORT
192 Host name used for remote debugging.
193 .TP
194 .B \-r | \-\-require SCRIPT
195 Require the library, before executing your script.
196 .TP
197 .B \-\-script FILE
198 Name of the script file to run.
199 .TP
200 .B \-x | \-\-trace
201 Show lines before executing them.
202 .TP
203 .B \-\-no\-quit
204 Do not quit when script terminates. Instead rerun the program.
205 .TP
206 .B \-\-version
207 Show the version number and exit.
208 .TP
209 .B \-\-verbose
210 Turn on verbose mode.
211 .TP
212 .B \-\-v
213 Print the version number, then turn on verbose mode if a script name
214 is given. If no script name is given just exit after printing the
215 version number.
216 .TP
217 .B \-\-nx
218 Don't execute commands found in any initialization files, e.g. .rdebugrc.
219 .TP
220 .B \-\-keep-frame-binding
221 Keep frame bindings.
222 .TP
223 .B \-\-script=FILE
224 Name of the script file to run
225 .B \-s | \-\-server
226 Listen for remote connections. Another rdebug session accesses using the \-\-client option.
227 See also the \-\-host, \-\-port and
228 \-\-cport options
229 .TP
230 .B \-w | \-\-wait
231 Wait for a client connection, implies -s option.
232 .TP
233 .B \-\-help
234 Show invocation help and exit.
235 .PD
236 .SH "SEE ALSO"
237 .Sp
238 http://rubyforge.org/projects/ruby-debug/
239 .SH AUTHOR
240 rdebug was written by Kent Siblev. This manual page was written by
241 Rocky Bernstein <rocky@gnu.org>
Something went wrong with that request. Please try again.