debug 1.0.0.alpha1 → 1.0.0.beta1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c921a03e7629b04e9629e77c5c6dac3adfa4acb33f4f72d325315a358d07058c
4
- data.tar.gz: eac06881f18621e16ac00f7ce628ff64c5aa7b60d99b725cdc30528e4c41b399
3
+ metadata.gz: 99f9de5fc37782d330788a745b34666e07d37c9e168eb7b0361d3b51b8247b56
4
+ data.tar.gz: 3e6941a9b066ec0965e576b87c8e0cc0bc787571fa5331ca962d906611c368e5
5
5
  SHA512:
6
- metadata.gz: 299218c5bbfa513df144365e8172ae270a681b3e8e0ab6b7953834d99454947c1a31ce2f6f9aa85b3ae798ac501ea8e4f8892deabf96ca835cb35112fd26a54b
7
- data.tar.gz: cac005fa02d12e187f586b2718d27d0c1463d03219a050102c9767540692cd609666cd6ea65db83a3bda54471c4a5ff10f06e1305b8ec013d5735b2633a2eebe
6
+ metadata.gz: a279de53e047d52c18c0b1c726da4bbf6efbd116f2957f3fa1c106fec929bb0dc903274d9fce8bb03a787f7ca31edd09d54a09b572027485c5a985205e518582
7
+ data.tar.gz: 5c436bdfa54ab8d2ece8c07fdac31481f0a9e4922ac433e871c09dd0b161d812eaf7c417189e0e9582421d8405a5169ec826065930c3a7441fdd72953c2786de
data/.gitignore CHANGED
@@ -6,3 +6,4 @@
6
6
  /pkg/
7
7
  /spec/reports/
8
8
  /tmp/
9
+ /Gemfile.lock
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ gem "rake", "~> 12.0"
6
+ gem "rake-compiler"
7
+ gem "minitest", "~> 5.0"
data/LICENSE.txt CHANGED
@@ -1,21 +1,22 @@
1
- The MIT License (MIT)
1
+ Copyright (C) 1993-2013 Yukihiro Matsumoto. All rights reserved.
2
2
 
3
- Copyright (c) 2021 Koichi Sasada
3
+ Redistribution and use in source and binary forms, with or without
4
+ modification, are permitted provided that the following conditions
5
+ are met:
6
+ 1. Redistributions of source code must retain the above copyright
7
+ notice, this list of conditions and the following disclaimer.
8
+ 2. Redistributions in binary form must reproduce the above copyright
9
+ notice, this list of conditions and the following disclaimer in the
10
+ documentation and/or other materials provided with the distribution.
4
11
 
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- THE SOFTWARE.
12
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
13
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
14
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
15
+ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
16
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
18
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
19
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
21
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
22
+ SUCH DAMAGE.
data/README.md CHANGED
@@ -1,86 +1,315 @@
1
1
  # debug.rb
2
2
 
3
- ## How to install
3
+ This library provides debugging functionality to Ruby.
4
+
5
+ This debug.rb is replacement of traditional lib/debug.rb standard library which is implemented by `set_trace_func`.
6
+ New debug.rb has several advantages:
7
+
8
+ * Fast: No performance penalty on non-stepping mode and non-breakpoints.
9
+ * Remote debugging: Support remote debugging natively.
10
+ * UNIX domain socket
11
+ * TCP/IP
12
+ * VSCode/DAP integration (TODO)
13
+ * Extensible: application can introduce debugging support with several methods
14
+ * By `rdbg` command
15
+ * By loading libraries with `-r` command line option
16
+ * By calling Ruby's method explicitly
17
+ * Misc
18
+ * Support threads (almost done) and ractors (TODO).
19
+ * Support suspending and entering to the console debugging with `Ctrl-C` at most of timing.
20
+ * Show parameters on backtrace command.
21
+
22
+ # Installation
4
23
 
5
24
  ```
6
- $ gem install debug
25
+ $ gem install debug --pre
7
26
  ```
8
27
 
9
- or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line options for development.
28
+ or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option, especially for debug this gem development.
10
29
 
11
30
  # How to use
12
31
 
13
32
  ## Invoke with debugger
14
33
 
15
- ### REPL debug
34
+ You can run ruby program on debugger with the local debug console or the remote debug console.
35
+
36
+ * (a) Run a ruby program with the local debug console
37
+ * (b) Run a ruby program with the remote debug console by opening a network port
38
+ * (b-1) Open with UNIX domain socket
39
+ * (b-2) Open with TCP/IP port
40
+
41
+ (b-1) is useful when you want to use debugging features after running the program.
42
+ (b-2) is also useful when you don't have a ssh access for the Ruby process.
43
+
44
+ To use debugging feature, you can have 3 ways.
45
+
46
+ * (1) Use `rdbg` command
47
+ * (2) Use `ruby -r debug...` command line option
48
+ * (3) Write `require 'debug...'` in .rb files
49
+
50
+ ### Local debug console
16
51
 
17
52
  ```
18
- $ ruby -r debug/repl target.rb
53
+ # (1) Use `rdbg` command
54
+ $ rdbg target.rb
55
+ $ rdbg -- -r foo -e expr # -- is required to make clear rdbg options and ruby's options
56
+
57
+ # (2) Use `-r debug/run` command line option
58
+
59
+ $ ruby -r debug/run target.rb
60
+
61
+ # (3) Write `require 'debug...' in .rb files
62
+
63
+ $ cat target.rb
64
+ require 'debug/run' # start the debug console
65
+ ...
66
+
67
+ # or
68
+
69
+ $ cat target.rb
70
+ require 'debug/session' # introduce the functionality
71
+ DEBUGGER__.console # and start the debug console
72
+
73
+ $ ruby target.rb
19
74
  ```
20
75
 
21
- and you can see the debugger prompt. The program was suspended at the beggining of target.rb. To continue the program, type `c` (or `continue`). See other debug commands below.
76
+ When you run the program with the debug console, you will see the debug console prompt `(rdbg)`.
77
+ The debuggee program (`target.rb`) is suspended at the beggining of `target.rb`.
22
78
 
23
- You can re-enable debug command mode by `Ctrl-C`.
79
+ You can type any debugger's command described bellow. "c" or "continue" resume the debuggee program.
80
+ You can suspend the debuggee program and show the debug console with `Ctrl-C`.
81
+
82
+ The following example shows simple usage of the debug console. You can show the all variables
83
+
84
+ ```
85
+ $ rdbg ~/src/rb/target.rb
86
+
87
+ [1, 5] in /home/ko1/src/rb/target.rb
88
+ => 1| a = 1
89
+ 2| b = 2
90
+ 3| c = 3
91
+ 4| p [a + b + c]
92
+ 5|
93
+ --> #0 /home/ko1/src/rb/target.rb:1:in `<main>'
94
+
95
+ (rdbg) info # Show all local variables
96
+ %self => main
97
+ a => nil
98
+ b => nil
99
+ c => nil
100
+
101
+ (rdbg) p a # Same as p(a)
102
+ => nil
103
+
104
+ (rdbg) s # Step in ("s" is a short name of "step")
105
+
106
+ [1, 5] in /home/ko1/src/rb/target.rb
107
+ 1| a = 1
108
+ => 2| b = 2
109
+ 3| c = 3
110
+ 4| p [a + b + c]
111
+ 5|
112
+ --> #0 /home/ko1/src/rb/target.rb:2:in `<main>'
113
+
114
+ (rdbg) <Enter> # Repeat the last command ("step")
115
+
116
+ [1, 5] in /home/ko1/src/rb/target.rb
117
+ 1| a = 1
118
+ 2| b = 2
119
+ => 3| c = 3
120
+ 4| p [a + b + c]
121
+ 5|
122
+ --> #0 /home/ko1/src/rb/target.rb:3:in `<main>'
123
+
124
+ (rdbg) # Repeat the last command ("step")
125
+
126
+ [1, 5] in /home/ko1/src/rb/target.rb
127
+ 1| a = 1
128
+ 2| b = 2
129
+ 3| c = 3
130
+ => 4| p [a + b + c]
131
+ 5|
132
+ --> #0 /home/ko1/src/rb/target.rb:4:in `<main>'
133
+
134
+ (rdbg) info # Show all local variables
135
+ %self => main
136
+ a => 1
137
+ b => 2
138
+ c => 3
139
+
140
+ (rdbg) c # Contineu the program ("c" is a short name of "continue")
141
+ [6]
142
+ ```
24
143
 
25
144
  ### Remote debug (1) UNIX domain socket
26
145
 
27
146
  ```
28
- $ ruby -r debug/unixserver target.rb
147
+ # (1) Use `rdbg` command
148
+ $ rdbg --open target.rb # or rdbg -O target.rb for shorthand
149
+ Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-5042)
150
+ ...
151
+
152
+ # (2) Use `-r debug/open` command line option
153
+
154
+ $ ruby -r debug/open target.rb
155
+ Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-5042)
156
+ ...
157
+
158
+ # (3) Write `require 'debug/open' in .rb files
159
+ $ cat target.rb
160
+ require 'debug/open' # open the debugger entry point by UNIX domain socket.
161
+ ...
162
+
163
+ # or
164
+
165
+ $ cat target.rb
166
+ require 'debug/server' # introduce remote debugging feature
167
+ DEBUGGER__.open # open the debugger entry point by UNIX domain socket.
168
+ # or DEBUGGER__.open_unix to specify UNIX domain socket.
169
+
170
+ $ ruby target.rb
171
+ Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-5042)
172
+ ...
29
173
  ```
30
174
 
31
175
  It runs target.rb and accept debugger connection within UNIX domain socket.
176
+ The debuggee process waits for debugger connection at the beggining of `target.rb` like that:
177
+
178
+ ```
179
+ $ rdbg -O ~/src/rb/target.rb
180
+ DEBUGGER: Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-29828)
181
+ DEBUGGER: wait for debuger connection...
182
+ ```
32
183
 
33
- You can attach the program with the folliowing command:
184
+ You can attach the program with the following command:
34
185
 
35
186
  ```
36
- $ ruby -r debug/client -e connect
37
- Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-20642)
38
- ...
187
+ $ rdbg --attach # or rdbg -A for shorthand
188
+
189
+ [1, 4] in /home/ko1/src/rb/target.rb
190
+ 1| (1..).each do |i|
191
+ => 2| sleep 0.5
192
+ 3| p i
193
+ 4| end
194
+ --> #0 [C] /home/ko1/src/rb/target.rb:2:in `sleep'
195
+ #1 /home/ko1/src/rb/target.rb:2:in `block in <main>' {|i=17|}
196
+ #2 [C] /home/ko1/src/rb/target.rb:1:in `each'
197
+ # and 1 frames (use `bt' command for all frames)
198
+
199
+ (rdb)
39
200
  ```
40
201
 
41
- The debugee process will be suspended and wait for the debug command.
202
+ and you can input any debug commands. `c` (or `continue`) continues the debuggee process.
203
+
204
+ You can detach the debugger from the debugger process with `quit` command.
205
+ You can re-connect to the debuggee process by `rdbg -A` command again, and the debuggee process suspends the execution (and debugger can input any debug commands).
206
+
207
+ If you don't want to stop the debuggee process at the beggining of debuggee process (`target.rb`), you can use the fowllowings to specify "non-stop" option.
42
208
 
43
- If you are running multiple debuggee processes, this command shows the selection like that:
209
+ * Use `rdbg -n` option
210
+ * Set the environment variable `RUBY_DEBUG_NONSTOP=1`
211
+
212
+ If you are running multiple debuggee processes, the attach command (`rdbg -A`) shows the options like that:
44
213
 
45
214
  ```
46
- $ ruby -r debug/client -e connect
215
+ $ rdbg --attach
47
216
  Please select a debug session:
48
217
  ruby-debug-ko1-19638
49
218
  ruby-debug-ko1-19603
50
219
  ```
51
220
 
52
- and you need to specify one:
221
+ and you need to specify one (copy and paste the name):
53
222
 
54
223
  ```
55
- $ ruby -r debug/client -e connect ruby-debug-ko1-19638
224
+ $ rdbg --attach ruby-debug-ko1-19638
56
225
  ```
57
226
 
58
227
  The socket file is located at
59
228
  * `RUBY_DEBUG_SOCK_DIR` environment variable if available.
60
229
  * `XDG_RUNTIME_DIR` environment variable if available.
61
- * `$HOME/ruby-debug-sock` if `$HOME` is available.
230
+ * `$HOME/.ruby-debug-sock` if `$HOME` is available.
62
231
 
63
232
  ### Remote debug (2) TCP/IP
64
233
 
234
+ You can open the TCP/IP port instead of using UNIX domain socket.
235
+
65
236
  ```
66
- $ RUBY_DEBUG_PORT=12345 RUBY_DEBUG_HOST=localhost ruby -r debug/tcpserver target.rb
237
+ # (1) Use `rdbg` command
238
+ $ rdbg -O --port=12345 target.rb
239
+ # or
240
+ $ rdbg --open --port=12345 target.rb
241
+ Debugger can attach via TCP/IP (localhost:12345)
242
+ ...
243
+
244
+ # (2) Use `-r debug/open` command line option
245
+
246
+ $ RUBY_DEBUG_PORT=12345 ruby -r debug/open target.rb
247
+ Debugger can attach via TCP/IP (localhost:12345)
248
+ ...
249
+
250
+ # (3) Write `require 'debug/open' in .rb files
251
+ $ cat target.rb
252
+ require 'debug/open' # open the debugger entry point.
253
+ ...
254
+
255
+ # and run with environment variable RUBY_DEBUG_PORT
256
+ $ RUBY_DEBUG_PORT=12345 ruby target.rb
257
+ Debugger can attach via TCP/IP (localhost:12345)
258
+ ...
259
+
260
+ # or
261
+
262
+ $ cat target.rb
263
+ require 'debug/server' # introduce remote debugging feature
264
+ DEBUGGER__.open(port: 12345)
265
+ # or DEBUGGER__.open_tcp(port: 12345)
266
+
267
+ $ ruby target.rb
67
268
  Debugger can attach via TCP/IP (localhost:12345)
68
269
  ...
69
270
  ```
70
271
 
71
- This command invoke target.rb with TCP/IP attach server with given port and host. If host is not given, `localhost` will be used.
272
+ You can also specify the host with the `RUBY_DEBUG_HOST` environment variable. And also `DEBUGGER__.open` method accepts a `host:` keyword parameter. If the host is not given, `localhost` will be used.
273
+
274
+ To attach the debuggee process, specify the port number (and hostname if needed) for the `rdbg --attach` (or `rdbg -A`) command.
72
275
 
73
276
  ```
74
- $ ruby -r debug/client -e connect localhost 12345
277
+ $ rdbg --attach 12345
278
+ $ rdbg --attach hostname 12345
75
279
  ```
76
280
 
77
- tries to connect with given host (`localhost`) and port (`12345`). You can eliminate host part and `localhost` will be used.
281
+ ### Initial scripts
282
+
283
+ If there are `.rdbgrc` files are there at the current directory and the home directory, files are loaded as initial scripts which contains debugger commands. `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
78
284
 
285
+ Initial scripts are evaluted at the first suspend timing (generally, it is the beggining of the target script). For example, you can set break points with `break file:123`.
79
286
 
80
- ## Debug command
287
+ If there are `.rdbgrc.rb` files at the current directory and the home directory, files are loaded as a ruby script at the initializing timing.
288
+
289
+ ### Environment variables
290
+
291
+ You can control debuggee's behavior with environment variables:
292
+
293
+ * `RUBY_DEBUG_NONSTOP`: 1 for nonstop at the beggining of program.
294
+ * `RUBY_DEBUG_INIT_SCRIPT`: Initial script path loaded at the first stop.
295
+ * `RUBY_DEBUG_COMMANDS`: Debug commands invoked at the first stop. Commands should be separated by ';;'.
296
+ * `RUBY_DEBUG_SHOW_SRC_LINES`: Show n lines source code on breakpoint (default: 10 lines).
297
+ * `RUBY_DEBUG_SHOW_FRAMES`: Show n frames on breakpoint (default: 2 frames).
298
+
299
+ * Remote debugging
300
+ * `RUBY_DEBUG_PORT`: TCP/IP remote debugging: port to open.
301
+ * `RUBY_DEBUG_HOST`: TCP/IP remote debugging: host (localhost if not given) to open.
302
+ * `RUBY_DEBUG_SOCK_DIR`: UNIX Domain Socket remote debugging: socket directory to open.
303
+
304
+ ## Debug command on the debug console
81
305
 
82
306
  * `Enter` repeats the last command (useful when repeating `step`s).
83
307
  * `Ctrl-D` is equal to `quit` command.
308
+ * [debug command compare sheet - Google Sheets](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyoMv-io52BUUz__R5wpu-ComXlsw0/edit?usp=sharing)
309
+
310
+ You can use the following debug commands. Each command should be written in 1 line.
311
+ The `[...]` notation means this part can be elimiante. For example, `s[tep]` means `s` or `step` are valid command. `ste` is not valid.
312
+ The `<...>` notation means the argument.
84
313
 
85
314
  ### Control flow
86
315
 
@@ -92,10 +321,10 @@ tries to connect with given host (`localhost`) and port (`12345`). You can elimi
92
321
  * Finish this frame. Resume the program until the current frame is finished.
93
322
  * `c[ontinue]`
94
323
  * Resume the program.
95
- * `q[uit]` or `Ctrl-D`
96
- * Finish debugger (with a process, if not remote debugging).
97
- * `kill`
98
- * Stop the debuggee program.
324
+ * `q[uit]` or exit or `Ctrl-D`
325
+ * Finish debugger (with the debuggee process on non-remote debugging).
326
+ * `kill` or `q[uit]!`
327
+ * Stop the debuggee process.
99
328
 
100
329
  ### Breakpoint
101
330
 
@@ -103,19 +332,61 @@ tries to connect with given host (`localhost`) and port (`12345`). You can elimi
103
332
  * Show all breakpoints.
104
333
  * `b[reak] <line>`
105
334
  * Set breakpoint on `<line>` at the current frame's file.
106
- * `b[reak] <file>:<line>`
335
+ * `b[reak] <file>:<line>` or `<file> <line>`
107
336
  * Set breakpoint on `<file>:<line>`.
337
+ * `b[reak] <class>#<name>`
338
+ * Set breakpoint on the method `<class>#<name>`.
339
+ * `b[reak] <expr>.<name>`
340
+ * Set breakpoint on the method `<expr>.<name>`.
341
+ * `b[reak] ... if <expr>`
342
+ * break if `<expr>` is true at specified location.
343
+ * `b[reak] if <expr>`
344
+ * break if `<expr>` is true at any lines.
345
+ * Note that this feature is super slow.
108
346
  * `catch <Error>`
109
347
  * Set breakpoint on raising `<Error>`.
348
+ * `watch <expr>`
349
+ * Stop the execution when the result of <expr> is changed.
350
+ * Note that this feature is super slow.
110
351
  * `del[ete]`
111
352
  * delete all breakpoints.
112
353
  * `del[ete] <bpnum>`
113
354
  * delete specified breakpoint.
114
355
 
115
- ### Frame control
356
+ ### Information
116
357
 
117
358
  * `bt` or `backtrace`
118
- * Show backtrace information.
359
+ * Show backtrace (frame) information.
360
+ * `l[ist]`
361
+ * Show current frame's source code.
362
+ * Next `list` command shows the successor lines.
363
+ * `l[ist] -`
364
+ * Show predecessor lines as opposed to the `list` command.
365
+ * `l[ist] <start>` or `l[ist] <start>-<end>`
366
+ * Show current frame's source code from the line <start> to <end> if given.
367
+ * `edit`
368
+ * Open the current file on the editor (use `EDITOR` environment variable).
369
+ * Note that editted file will not be reloaded.
370
+ * `edit <file>`
371
+ * Open <file> on the editor.
372
+ * `i[nfo]`
373
+ * Show information about the current frame (local variables)
374
+ * It includes `self` as `%self` and a return value as `%return`.
375
+ * `i[nfo] <expr>`
376
+ * Show information about the result of <expr>.
377
+ * `display`
378
+ * Show display setting.
379
+ * `display <expr>`
380
+ * Show the result of `<expr>` at every suspended timing.
381
+ * `undisplay`
382
+ * Remove all display settings.
383
+ * `undisplay <displaynum>`
384
+ * Remove a specified display setting.
385
+ * `trace [on|off]`
386
+ * enable or disable line tracer.
387
+
388
+ ### Frame control
389
+
119
390
  * `f[rame]`
120
391
  * Show current frame.
121
392
  * `f[rame] <framenum>`
@@ -133,30 +404,61 @@ tries to connect with given host (`localhost`) and port (`12345`). You can elimi
133
404
  * Evaluate like `pp <expr>` on the current frame.
134
405
  * `e[val] <expr>`
135
406
  * Evaluate `<expr>` on the current frame.
136
-
137
- ### Information
138
-
139
- * `list`
140
- * Show current frame's source code.
141
- * `info l[ocal[s]]`
142
- * Show current frame's local variables. It includes `self` as `%self` and a return value as `%return`.
143
- * `info i[nstance]` or `info ivars`
144
- * Show current frame's insntance variables.
145
- * `display`
146
- * Show display setting.
147
- * `display <expr>`
148
- * Add `<expr>` at suspended timing.
149
- * `undisplay`
150
- * Remove all display settings.
151
- * `undisplay <displaynum>`
152
- * Remove a specified display setting.
153
- * `trace [on|off]`
154
- * enable or disable line tracer.
407
+ * `irb`
408
+ * Invoke `irb` on the current frame.
155
409
 
156
410
  ### Thread control
157
411
 
158
- * `th[read] [l[ist]]`
412
+ * `th[read]`
159
413
  * Show all threads.
160
414
  * `th[read] <thnum>`
161
- * Switch thread specified by `<thnum>`
415
+ * Switch thread specified by `<thnum>`.
416
+
417
+ ### Help
418
+
419
+ * `h[elp]`
420
+ * Show help for all commands.
421
+ * `h[elp] <command>`
422
+ * Show help for the given command.
423
+
424
+
425
+ ## rdbg command help
426
+
427
+ ```
428
+ exe/rdbg [options] -- [debuggee options]
429
+
430
+ Debug console mode:
431
+ -n, --nonstop Do not stop at the beggining of the script.
432
+ -e [COMMAND] execute debug command at the beggining of the script.
433
+ -O, --open Start debuggee with opning the debagger port.
434
+ If TCP/IP options are not given,
435
+ a UNIX domain socket will be used.
436
+ --port=[PORT] Listening TCP/IP port
437
+ --host=[HOST] Listening TCP/IP host
438
+
439
+ Debug console mode runs Ruby program with the debug console.
440
+
441
+ exe/rdbg target.rb foo bar starts like 'ruby target.rb foo bar'.
442
+ exe/rdbg -- -r foo -e bar starts like 'ruby -r foo -e bar'.
443
+ exe/rdbg -O target.rb foo bar starts and accepts attaching with UNIX domain socket.
444
+ exe/rdbg -O --port 1234 target.rb foo bar starts accepts attaching with TCP/IP localhost:1234.
445
+ exe/rdbg -O --port 1234 -- -r foo -e bar starts accepts attaching with TCP/IP localhost:1234.
446
+
447
+ Attach mode:
448
+ -A, --attach Attach to debuggee process.
449
+
450
+ Attach mode attaches the remote debug console to the debuggee process.
451
+
452
+ 'exe/rdbg -A' tries to connect via UNIX domain socket.
453
+ If there are multiple processes are waiting for the
454
+ debugger connection, list possible debuggee names.
455
+ 'exe/rdbg -A path' tries to connect via UNIX domain socket with given path name.
456
+ 'exe/rdbg -A port' tries to connect localhost:port via TCP/IP.
457
+ 'exe/rdbg -A host port' tris to connect host:port via TCP/IP.
458
+
459
+ ```
460
+
461
+ # Contributing
462
+
463
+ Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/debug.
162
464