ed-precompiled_debug 1.11.0-arm64-darwin

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.
data/README.md ADDED
@@ -0,0 +1,996 @@
1
+ [![Ruby](https://github.com/ruby/debug/actions/workflows/ruby.yml/badge.svg?branch=master)](https://github.com/ruby/debug/actions/workflows/ruby.yml?query=branch%3Amaster) [![Protocol](https://github.com/ruby/debug/actions/workflows/protocol.yml/badge.svg)](https://github.com/ruby/debug/actions/workflows/protocol.yml)
2
+
3
+ # debug.rb
4
+
5
+ This library provides debugging functionality to Ruby (MRI) 2.7 and later.
6
+
7
+ This debug.rb is the replacement of traditional lib/debug.rb standard library, which is implemented by `set_trace_func`.
8
+ New debug.rb has several advantages:
9
+
10
+ * Fast: No performance penalty on non-stepping mode and non-breakpoints.
11
+ * [Remote debugging](#remote-debugging): Support remote debugging natively.
12
+ * UNIX domain socket (UDS)
13
+ * TCP/IP
14
+ * Integration with rich debugger frontends
15
+
16
+ | Frontend | [Console](https://github.com/ruby/debug#invoke-as-a-remote-debuggee) | [VSCode](https://github.com/ruby/debug#vscode-integration) | [Chrome DevTool](#chrome-devtool-integration) |
17
+ | ----------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------- |
18
+ | Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
19
+ | Requirement | None | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |
20
+
21
+ * Extensible: application can introduce debugging support in several ways:
22
+ * By `rdbg` command
23
+ * By loading libraries with `-r` command line option
24
+ * By calling Ruby's method explicitly
25
+ * Misc
26
+ * Support threads (almost done) and Ractors (TODO).
27
+ * Support suspending and entering the debug console with `Ctrl-C` at most of timing.
28
+ * Show parameters on backtrace command.
29
+ * Support recording and replay debugging.
30
+
31
+ # Installation
32
+
33
+ ```console
34
+ $ gem install debug
35
+ ```
36
+
37
+ Alternatively, specify `-Ipath/to/debug/lib` in `RUBYOPT`, or as a Ruby command-line option
38
+ This is especially useful for debugging this gem during development.
39
+
40
+ If using Bundler, add the following to your Gemfile:
41
+
42
+ ```ruby
43
+ gem "debug", ">= 1.0.0"
44
+ ```
45
+
46
+ (The version constraint is important; `debug < 1.0.0` is an older, abandoned gem that is completely different from this product.)
47
+
48
+ # HOW TO USE
49
+
50
+ To use the debugger, you will do roughly the following steps:
51
+
52
+ 1. Set breakpoints.
53
+ 2. Run a program with the debugger.
54
+ 3. At the breakpoint, enter the debugger console.
55
+ 4. Use debug commands.
56
+ * [Evaluate Ruby expressions](#evaluate) (e.g. `p lvar` to see the local variable `lvar`).
57
+ * [Query the program status](#information) (e.g. `info` to see information about the current frame).
58
+ * [Control program flow](#control-flow) (e.g. move to another line with `step`, to the next line with `next`).
59
+ * [Set another breakpoint](#breakpoint) (e.g. `catch Exception` to set a breakpoint that'll be triggered when `Exception` is raised).
60
+ * [Activate tracing in your program](#trace) (e.g. `trace call` to trace method calls).
61
+ * [Change the configuration](#configuration-1) (e.g. `config set no_color true` to disable coloring).
62
+ * Continue the program (`c` or `continue`) and goto 3.
63
+
64
+ ## Invoke with the debugger
65
+
66
+ There are several ways to invoke the debugger, depending on your needs, preferences, and the environment.
67
+
68
+ ### Modify source code with [`binding.break`](#bindingbreak-method) (similar to `binding.pry` or `binding.irb`)
69
+
70
+ If you can modify the source code, you can use the debugger by adding `require 'debug'` at the top of your program and putting [`binding.break`](#bindingbreak-method) method into lines where you want to stop as breakpoints.
71
+ This is similar to how `binding.pry` and `binding.irb` work.
72
+
73
+ `binding.break` has two aliases which do the same thing:
74
+
75
+ - `binding.b`
76
+ - `debugger`
77
+
78
+ After that, run the program as usual and you will enter the debug console at breakpoints you inserted.
79
+
80
+ The following is an example of the [`binding.break`](#bindingbreak-method) method.
81
+
82
+ ```console
83
+ $ cat target.rb # Sample program
84
+ require 'debug'
85
+
86
+ a = 1
87
+ b = 2
88
+ binding.break # Program will stop here
89
+ c = 3
90
+ d = 4
91
+ binding.break # Program will stop here
92
+ p [a, b, c, d]
93
+
94
+ $ ruby target.rb # Run the program normally.
95
+ DEBUGGER: Session start (pid: 7604)
96
+ [1, 10] in target.rb
97
+ 1| require 'debug'
98
+ 2|
99
+ 3| a = 1
100
+ 4| b = 2
101
+ => 5| binding.break # Now you can see it stops at this line
102
+ 6| c = 3
103
+ 7| d = 4
104
+ 8| binding.break
105
+ 9| p [a, b, c, d]
106
+ 10|
107
+ =>#0 <main> at target.rb:5
108
+
109
+ (rdbg) info locals # You can show local variables
110
+ =>#0 <main> at target.rb:5
111
+ %self => main
112
+ a => 1
113
+ b => 2
114
+ c => nil
115
+ d => nil
116
+
117
+ (rdbg) continue # Continue the execution
118
+ [3, 11] in target.rb
119
+ 3| a = 1
120
+ 4| b = 2
121
+ 5| binding.break
122
+ 6| c = 3
123
+ 7| d = 4
124
+ => 8| binding.break # Again the program stops here
125
+ 9| p [a, b, c, d]
126
+ 10|
127
+ 11| __END__
128
+ =>#0 <main> at target.rb:8
129
+
130
+ (rdbg) info locals # And you can see the updated local variables
131
+ =>#0 <main> at target.rb:8
132
+ %self => main
133
+ a => 1
134
+ b => 2
135
+ c => 3
136
+ d => 4
137
+
138
+ (rdbg) continue
139
+ [1, 2, 3, 4]
140
+ ```
141
+
142
+ ### Invoke the program from the debugger as a traditional debuggers
143
+
144
+ If you don't want to modify the source code, you can use the `rdbg` command (or `bundle exec rdbg`) to run the program with the debugger.
145
+ This is similar to how you'd launch a program with `ruby program.rb`.
146
+ Then you can set breakpoints with the debug command `break` (`b` for short).
147
+
148
+ ```console
149
+ $ cat target.rb # Sample program
150
+ a = 1
151
+ b = 2
152
+ c = 3
153
+ d = 4
154
+ p [a, b, c, d]
155
+
156
+ $ rdbg target.rb # run like `ruby target.rb`
157
+ DEBUGGER: Session start (pid: 7656)
158
+ [1, 7] in target.rb
159
+ => 1| a = 1
160
+ 2| b = 2
161
+ 3| c = 3
162
+ 4| d = 4
163
+ 5| p [a, b, c, d]
164
+ 6|
165
+ 7| __END__
166
+ =>#0 <main> at target.rb:1
167
+
168
+ (rdbg)
169
+ ```
170
+
171
+ The `rdbg` command suspends the program at the beginning of the given script (`target.rb` in this case) and you can use debug commands to control execution from there.
172
+ `(rdbg)` is the console prompt.
173
+ Let's set breakpoints on line 3 and line 5 with `break` command (`b` for short).
174
+
175
+ ```console
176
+ (rdbg) break 3 # set breakpoint at line 3
177
+ #0 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:3 (line)
178
+
179
+ (rdbg) b 5 # set breakpoint at line 5
180
+ #1 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:5 (line)
181
+
182
+ (rdbg) break # show all registered breakpoints
183
+ #0 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:3 (line)
184
+ #1 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:5 (line)
185
+ ```
186
+
187
+ You can see that two breakpoints are registered.
188
+ Let's continue the program by using the `continue` command.
189
+
190
+ ```console
191
+ (rdbg) continue
192
+ [1, 7] in target.rb
193
+ 1| a = 1
194
+ 2| b = 2
195
+ => 3| c = 3
196
+ 4| d = 4
197
+ 5| p [a, b, c, d]
198
+ 6|
199
+ 7| __END__
200
+ =>#0 <main> at target.rb:3
201
+
202
+ Stop by #0 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:3 (line)
203
+
204
+ (rdbg)
205
+ ```
206
+
207
+ You can see that we stopped at line 3.
208
+ Let's see the local variables with the `info` command, and continue execution with the `continue`.
209
+ The program will then suspend at line 5 and you can use the `info` command again.
210
+
211
+ ```console
212
+ (rdbg) info
213
+ =>#0 <main> at target.rb:3
214
+ %self => main
215
+ a => 1
216
+ b => 2
217
+ c => nil
218
+ d => nil
219
+
220
+ (rdbg) continue
221
+ [1, 7] in target.rb
222
+ 1| a = 1
223
+ 2| b = 2
224
+ 3| c = 3
225
+ 4| d = 4
226
+ => 5| p [a, b, c, d]
227
+ 6|
228
+ 7| __END__
229
+ =>#0 <main> at target.rb:5
230
+
231
+ Stop by #1 BP - Line /mnt/c/ko1/src/rb/ruby-debug/target.rb:5 (line)
232
+
233
+ (rdbg) info
234
+ =>#0 <main> at target.rb:5
235
+ %self => main
236
+ a => 1
237
+ b => 2
238
+ c => 3
239
+ d => 4
240
+
241
+ (rdbg) continue
242
+ [1, 2, 3, 4]
243
+ ```
244
+
245
+ NOTE: When using `rdbg` you can suspend your application with `C-c` (SIGINT) and enter the debug console.
246
+ It will help if you want to know what the program is doing.
247
+
248
+ ### Use `rdbg` with commands written in Ruby
249
+
250
+ If you want to run an executable written in Ruby like `rake`, `rails`, `bundle`, `rspec`, and so on, you can use `rdbg -c` option.
251
+
252
+ * Without the `-c` option, `rdbg <name>` means that `<name>` is a Ruby script and it is invoked like `ruby <name>` with the debugger.
253
+ * With the `-c` option, `rdbg -c <name>` means that `<name>` is an executable in `PATH` and simply invokes it with the debugger.
254
+
255
+ Examples:
256
+
257
+ * `rdbg -c -- rails server`
258
+ * `rdbg -c -- bundle exec ruby foo.rb`
259
+ * `rdbg -c -- bundle exec rake test`
260
+ * `rdbg -c -- ruby target.rb` is the same as `rdbg target.rb`
261
+
262
+ NOTE: `--` is needed to separate the command line options for `rdbg` from the executable being invoked, and its options.
263
+ For example, `rdbg -c rake -T` would be parsed as `rdbg -c -T -- rake`, which is incorrect.
264
+ It should be `rdbg -c -- rake -T`.
265
+
266
+ NOTE: If you want to use Bundler (`bundle` executable), you need to add `gem 'debug'` to your `Gemfile`.
267
+
268
+ ### Using VSCode
269
+
270
+ Like other languages, you can use this debugger on the VSCode.
271
+
272
+ 1. Install [VSCode rdbg Ruby Debugger - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg)
273
+ 2. Open `.rb` file (e.g. `target.rb`)
274
+ 3. Register breakpoints with "Toggle breakpoint" in the Run menu (or type F9 key)
275
+ 4. Choose "Start debugging" in "Run" menu (or type F5 key)
276
+ 5. You will see a dialog "Debug command line" and you can choose your favorite command line you want to run.
277
+ 6. Chosen command line is invoked with `rdbg -c`, and VSCode shows the details at breakpoints.
278
+
279
+ Please refer to [Debugging in Visual Studio Code](https://code.visualstudio.com/docs/editor/debugging) for operations on VSCode.
280
+
281
+ You can configure the extension in `.vscode/launch.json`.
282
+ Please see the extension page for more details.
283
+
284
+ ## Remote debugging
285
+
286
+ You can use this debugger as a remote debugger.
287
+ For example, it will help in the following situations:
288
+
289
+ * Your application does not run on TTY, and it is hard to use `binding.pry` or `binding.irb`.
290
+ * Your application is running on a Docker container, and there is no TTY.
291
+ * Your application is running as a daemon.
292
+ * Your application uses pipe for `STDIN` or `STDOUT`.
293
+ * Your application is running as a daemon and you want to query the running status (checking a backtrace and so on).
294
+
295
+ You can run your application as a remote debuggee, and the remote debugger console can attach to the debuggee anytime.
296
+
297
+ ### Invoke as a remote debuggee
298
+
299
+ There are multiple ways to run your program as a debuggee:
300
+
301
+ | Stop at program start | [`rdbg` option](https://github.com/ruby/debug#rdbg---open-or-rdbg--o-for-short) | [require](https://github.com/ruby/debug#require-debugopen-in-a-program) | [debugger API](https://github.com/ruby/debug#start-by-method) |
302
+ | --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------- |
303
+ | Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open` |
304
+ | No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)` |
305
+
306
+ #### `rdbg --open` (or `rdbg -O` for short)
307
+
308
+ Launch a script with `rdbg --open target.rb` to run `target.rb` as a debuggee program.
309
+ It also opens the network port and suspends at the beginning of `target.rb`.
310
+
311
+ ```console
312
+ $ rdbg --open target.rb
313
+ DEBUGGER: Session start (pid: 7773)
314
+ DEBUGGER: Debugger can attach via UNIX domain socket (/home/ko1/.ruby-debug-sock/ruby-debug-ko1-7773)
315
+ DEBUGGER: wait for debugger connection...
316
+ ```
317
+
318
+ By default, `rdbg --open` uses UNIX domain socket and generates the path name automatically (`/home/ko1/.ruby-debug-sock/ruby-debug-ko1-7773` in this case).
319
+
320
+ You can connect to the debuggee with `rdbg --attach` command (`rdbg -A` for short).
321
+
322
+ ```console
323
+ $ rdbg -A
324
+ [1, 7] in target.rb
325
+ => 1| a = 1
326
+ 2| b = 2
327
+ 3| c = 3
328
+ 4| d = 4
329
+ 5| p [a, b, c, d]
330
+ 6|
331
+ 7| __END__
332
+ =>#0 <main> at target.rb:1
333
+
334
+ (rdbg:remote)
335
+ ```
336
+
337
+ If there are no other files in the default directory, `rdbg --attach` will automatically connect to the UNIX domain socket listed.
338
+ If there are multiple files, you need to specify which to use.
339
+
340
+ When `rdbg --attach` connects to the debuggee, you can use any debug commands (set breakpoints, continue the program, and so on) like the local debug console.
341
+ When a debuggee program exits, the remote console will also terminate.
342
+
343
+ NOTE: If you use the `quit` command, only the remote console exits and the debuggee program continues to run (and you can connect it again).
344
+ If you want to exit the debuggee program, use `kill` command.
345
+
346
+ If you want to use TCP/IP for remote debugging, you need to specify the port and host with `--port` like `rdbg --open --port 12345` and it binds to `localhost:12345`.
347
+ You can add an optional `--port_range` to try multiple ports in a reliable way.
348
+ For example, `rdbg --open --port 12345 --port_range 10` will try to bind to 12345, 12346, 12347,… until it finds an available port.
349
+
350
+ To connect to the debuggee, you need to specify the port.
351
+
352
+ ```console
353
+ $ rdbg --attach 12345
354
+ ```
355
+
356
+ If you want to choose the host to bind, you can use `--host` option.
357
+ Messages communicated between the debugger and the debuggee are *NOT* encrypted so please use remote debugging carefully.
358
+
359
+ #### `require 'debug/open'` in a program
360
+
361
+ If you can modify the program, you can open the debugging port by adding `require 'debug/open'` in the program.
362
+
363
+ If you don't want to stop the program at the beginning, you can also use `require 'debug/open_nonstop'`.
364
+ Using `debug/open_nonstop` is useful if you want to open a backdoor to the application.
365
+ However, it is also dangerous because it can become another vulnerability.
366
+ Please use it carefully.
367
+
368
+ By default, UNIX domain socket is used for the debugging port.
369
+ To use TCP/IP, you can set the `RUBY_DEBUG_PORT` environment variable.
370
+
371
+ ```console
372
+ $ RUBY_DEBUG_PORT=12345 ruby target.rb
373
+ ```
374
+
375
+ ### Integration with external debugger frontend
376
+
377
+ You can attach with external debugger frontend with VSCode and Chrome.
378
+
379
+ ```
380
+ $ rdbg --open=[frontend] target.rb
381
+ ```
382
+
383
+ This will open a debug port and the `[frontend]` can attach to the port.
384
+
385
+ #### VSCode integration
386
+
387
+ ([vscode-rdbg v0.0.9](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) or later is required)
388
+
389
+ If you don't run a debuggee Ruby process on VSCode, you can attach it to VSCode later with the following steps.
390
+
391
+ `rdbg --open=vscode` opens the debug port and tries to invoke the VSCode (`code` executable).
392
+
393
+ ```console
394
+ $ rdbg --open=vscode target.rb
395
+ DEBUGGER: Debugger can attach via UNIX domain socket (/tmp/ruby-debug-sock-1000/ruby-debug-ko1-27706)
396
+ DEBUGGER: wait for debugger connection...
397
+ Launching: code /tmp/ruby-debug-vscode-20211014-27706-gd7e85/ /tmp/ruby-debug-vscode-20211014-27706-gd7e85/README.rb
398
+ DEBUGGER: Connected.
399
+ ```
400
+
401
+ It tries to invoke the new VSCode window and VSCode will attach to the debuggee Ruby program automatically.
402
+
403
+ You can also use `open vscode` in a REPL.
404
+
405
+ ```console
406
+ $ rdbg target.rb
407
+ [1, 8] in target.rb
408
+ 1|
409
+ => 2| p a = 1
410
+ 3| p b = 2
411
+ 4| p c = 3
412
+ 5| p d = 4
413
+ 6| p e = 5
414
+ 7|
415
+ 8| __END__
416
+ =>#0 <main> at target.rb:2
417
+ (rdbg) open vscode # command
418
+ DEBUGGER: wait for debugger connection...
419
+ DEBUGGER: Debugger can attach via UNIX domain socket (/tmp/ruby-debug-sock-1000/ruby-debug-ko1-28337)
420
+ Launching: code /tmp/ruby-debug-vscode-20211014-28337-kg9dm/ /tmp/ruby-debug-vscode-20211014-28337-kg9dm/README.rb
421
+ DEBUGGER: Connected.
422
+ ```
423
+
424
+ If the machine which runs the Ruby process doesn't have a `code` executable on `$PATH`, the following message will be shown:
425
+
426
+ ```console
427
+ (rdbg) open vscode
428
+ DEBUGGER: wait for debugger connection...
429
+ DEBUGGER: Debugger can attach via UNIX domain socket (/tmp/ruby-debug-sock-1000/ruby-debug-ko1-455)
430
+ Launching: code /tmp/ruby-debug-vscode-20211014-455-gtjpwi/ /tmp/ruby-debug-vscode-20211014-455-gtjpwi/README.rb
431
+ DEBUGGER: Can not invoke the command.
432
+ Use the command-line on your terminal (with modification if you need).
433
+
434
+ code /tmp/ruby-debug-vscode-20211014-455-gtjpwi/ /tmp/ruby-debug-vscode-20211014-455-gtjpwi/README.rb
435
+
436
+ If your application is running on a SSH remote host, please try:
437
+
438
+ code --remote ssh-remote+[SSH hostname] /tmp/ruby-debug-vscode-20211014-455-gtjpwi/ /tmp/ruby-debug-vscode-20211014-455-gtjpwi/README.rb
439
+
440
+ ```
441
+
442
+ Note that you can attach with `rdbg --attach` and continue REPL debugging.
443
+
444
+ #### Chrome DevTool integration
445
+
446
+ Using `rdbg --open=chrome` will show the following message:
447
+
448
+ ```console
449
+ $ rdbg target.rb --open=chrome
450
+ DEBUGGER: Debugger can attach via TCP/IP (127.0.0.1:43633)
451
+ DEBUGGER: With Chrome browser, type the following URL in the address-bar:
452
+
453
+ devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef
454
+
455
+ DEBUGGER: wait for debugger connection...
456
+ ```
457
+
458
+ Type the following in the address bar on Chrome browser, and you can continue the debugging with chrome browser:
459
+
460
+ ```txt
461
+ devtools://devtools/bundled/inspector.html?v8only=true&panel=sources&ws=127.0.0.1:57231/b32a55cd-2eb5-4c5c-87d8-b3dfc59d80ef`
462
+ ```
463
+
464
+ Similar to VSCode, you can use `open chrome` to open the debugger in Chrome.
465
+
466
+ For more information about how to use Chrome debugging, [see the devtools docs](https://developer.chrome.com/docs/devtools/).
467
+
468
+ ## Configuration
469
+
470
+ You can configure the debugger's behavior with debug commands and environment variables.
471
+ When the debug session is started, some [initialization scripts](#initial-scripts) (e.g., `~/.rdbgrc`) are loaded, allowing you to configure the debugger's behavior to your needs and preferences.
472
+
473
+ ### Configuration list
474
+
475
+ You can configure the debugger's behavior with environment variables and `config` command.
476
+ Each configuration has an environment variable and a name which can be specified by `config` command.
477
+
478
+ ```
479
+ # configuration example
480
+ config set log_level INFO
481
+ config set no_color true
482
+ ```
483
+
484
+
485
+
486
+ * UI
487
+ * `RUBY_DEBUG_LOG_LEVEL` (`log_level`): Log level same as Logger (default: WARN)
488
+ * `RUBY_DEBUG_SHOW_SRC_LINES` (`show_src_lines`): Show n lines source code on breakpoint (default: 10)
489
+ * `RUBY_DEBUG_SHOW_SRC_LINES_FRAME` (`show_src_lines_frame`): Show n lines source code on frame operations (default: 1)
490
+ * `RUBY_DEBUG_SHOW_EVALEDSRC` (`show_evaledsrc`): Show actually evaluated source (default: false)
491
+ * `RUBY_DEBUG_SHOW_FRAMES` (`show_frames`): Show n frames on breakpoint (default: 2)
492
+ * `RUBY_DEBUG_USE_SHORT_PATH` (`use_short_path`): Show shorten PATH (like $(Gem)/foo.rb) (default: false)
493
+ * `RUBY_DEBUG_NO_COLOR` (`no_color`): Do not use colorize (default: false)
494
+ * `RUBY_DEBUG_NO_SIGINT_HOOK` (`no_sigint_hook`): Do not suspend on SIGINT (default: false)
495
+ * `RUBY_DEBUG_NO_RELINE` (`no_reline`): Do not use Reline library (default: false)
496
+ * `RUBY_DEBUG_NO_HINT` (`no_hint`): Do not show the hint on the REPL (default: false)
497
+ * `RUBY_DEBUG_NO_LINENO` (`no_lineno`): Do not show line numbers (default: false)
498
+ * `RUBY_DEBUG_NO_REPEAT` (`no_repeat`): Do not repeat last line when empty line (default: false)
499
+ * `RUBY_DEBUG_IRB_CONSOLE` (`irb_console`): Use IRB as the console (default: false)
500
+
501
+ * CONTROL
502
+ * `RUBY_DEBUG_SKIP_PATH` (`skip_path`): Skip showing/entering frames for given paths
503
+ * `RUBY_DEBUG_SKIP_NOSRC` (`skip_nosrc`): Skip on no source code lines (default: false)
504
+ * `RUBY_DEBUG_KEEP_ALLOC_SITE` (`keep_alloc_site`): Keep allocation site and p, pp shows it (default: false)
505
+ * `RUBY_DEBUG_POSTMORTEM` (`postmortem`): Enable postmortem debug (default: false)
506
+ * `RUBY_DEBUG_FORK_MODE` (`fork_mode`): Control which process activates a debugger after fork (both/parent/child) (default: both)
507
+ * `RUBY_DEBUG_SIGDUMP_SIG` (`sigdump_sig`): Sigdump signal (default: false)
508
+
509
+ * BOOT
510
+ * `RUBY_DEBUG_NONSTOP` (`nonstop`): Nonstop mode (default: false)
511
+ * `RUBY_DEBUG_STOP_AT_LOAD` (`stop_at_load`): Stop at just loading location (default: false)
512
+ * `RUBY_DEBUG_INIT_SCRIPT` (`init_script`): debug command script path loaded at first stop
513
+ * `RUBY_DEBUG_COMMANDS` (`commands`): debug commands invoked at first stop. Commands should be separated by `;;`
514
+ * `RUBY_DEBUG_NO_RC` (`no_rc`): ignore loading ~/.rdbgrc(.rb) (default: false)
515
+ * `RUBY_DEBUG_HISTORY_FILE` (`history_file`): history file (default: ${XDG_STATE_HOME-~/.local/state}/rdbg/history)
516
+ * `RUBY_DEBUG_SAVE_HISTORY` (`save_history`): maximum save history lines (default: 10000)
517
+
518
+ * REMOTE
519
+ * `RUBY_DEBUG_OPEN` (`open`): Open remote port (same as `rdbg --open` option)
520
+ * `RUBY_DEBUG_PORT` (`port`): TCP/IP remote debugging: port
521
+ * `RUBY_DEBUG_PORT_RANGE` (`port_range`): TCP/IP remote debugging: length of port range
522
+ * `RUBY_DEBUG_HOST` (`host`): TCP/IP remote debugging: host (default: 127.0.0.1)
523
+ * `RUBY_DEBUG_SOCK_PATH` (`sock_path`): UNIX Domain Socket remote debugging: socket path
524
+ * `RUBY_DEBUG_SOCK_DIR` (`sock_dir`): UNIX Domain Socket remote debugging: socket directory
525
+ * `RUBY_DEBUG_LOCAL_FS_MAP` (`local_fs_map`): Specify local fs map
526
+ * `RUBY_DEBUG_SKIP_BP` (`skip_bp`): Skip breakpoints if no clients are attached (default: false)
527
+ * `RUBY_DEBUG_COOKIE` (`cookie`): Cookie for negotiation
528
+ * `RUBY_DEBUG_SESSION_NAME` (`session_name`): Session name for differentiating multiple sessions
529
+ * `RUBY_DEBUG_CHROME_PATH` (`chrome_path`): Platform dependent path of Chrome (For more information, See [here](https://github.com/ruby/debug/pull/334/files#diff-5fc3d0a901379a95bc111b86cf0090b03f857edfd0b99a0c1537e26735698453R55-R64))
530
+
531
+ * OBSOLETE
532
+ * `RUBY_DEBUG_PARENT_ON_FORK` (`parent_on_fork`): Keep debugging parent process on fork (default: false)
533
+
534
+ There are other environment variables:
535
+
536
+ * `NO_COLOR`: If the value is set, set `RUBY_DEBUG_NO_COLOR` ([NO_COLOR: disabling ANSI color output in various Unix commands](https://no-color.org/)).
537
+ * `RUBY_DEBUG_ENABLE`: If the value is `0`, do not enable debug.gem feature.
538
+ * `RUBY_DEBUG_ADDED_RUBYOPT`: Remove this value from `RUBYOPT` at first. This feature helps loading debug.gem with `RUBYOPT='-r debug/...'`, and you don't want to derive it to child processes. In this case, you can set `RUBY_DEBUG_ADDED_RUBYOPT='-r debug/...'` (same value), and this string will be deleted from `RUBYOPT` at first.
539
+ * `RUBY_DEBUG_EDITOR` or `EDITOR`: An editor used by `edit` debug command.
540
+ * `RUBY_DEBUG_BB`: Define `Kernel#bb` method which is alias of `Kernel#debugger`.
541
+
542
+ ### Initial scripts
543
+
544
+ If there is a `~/.rdbgrc` file it is loaded as an initialization script (which contains debug commands) when the debug session is started.
545
+
546
+ * `RUBY_DEBUG_INIT_SCRIPT` environment variable can specify the initial script file.
547
+ * You can specify the initial script with `rdbg -x initial_script` (like gdb's `-x` option).
548
+
549
+ Initial scripts are useful to write your favorite configurations.
550
+ For example, you can set breakpoints with `break file:123` in `~/.rdbgrc`.
551
+
552
+ If there is a `~/.rdbgrc.rb` file it is also loaded as a Ruby script when the debug session is started.
553
+
554
+ ## Debug command on the debug console
555
+
556
+ On the debug console, you can use the following debug commands.
557
+
558
+ There are additional features:
559
+
560
+ * `<expr>` without debug command is almost the same as `pp <expr>`.
561
+ * If the input line `<expr>` does *NOT* start with any debug command, the line `<expr>` will be evaluated as a Ruby expression, and the result will be printed with `pp` method.
562
+ So that the input `foo.bar` is the same as `pp foo.bar`.
563
+ * If `<expr>` is recognized as a debug command, of course, it is not evaluated as a Ruby expression but is executed as debug command.
564
+ For example, you can not evaluate such single-letter local variables `i`, `b`, `n`, `c` because they are single-letter debug commands. Use `p i` instead.
565
+ * For consistency, the author (Koichi Sasada) recommends using the `p`, `pp`, or `eval` command to evaluate the Ruby expression every time.
566
+ * `Enter` without any input repeats the last command (useful when repeating `step`s) for some commands.
567
+ * `Ctrl-D` is equal to `quit` command.
568
+ * [debug command compare sheet - Google Sheets](https://docs.google.com/spreadsheets/d/1TlmmUDsvwK4sSIyoMv-io52BUUz__R5wpu-ComXlsw0/edit?usp=sharing)
569
+
570
+ You can use the following debug commands.
571
+ Each command should be written in 1 line.
572
+ The `[…]` notation means this part can be eliminated. For example, `s[tep]` means `s` or `step` is a valid command. `ste` is not valid.
573
+ The `<…>` notation means the argument.
574
+
575
+ ### Control flow
576
+
577
+ * `s[tep]`
578
+ * Step in. Resume the program until next breakable point.
579
+ * `s[tep] <n>`
580
+ * Step in, resume the program at `<n>`th breakable point.
581
+ * `n[ext]`
582
+ * Step over. Resume the program until next line.
583
+ * `n[ext] <n>`
584
+ * Step over, same as `step <n>`.
585
+ * `fin[ish]`
586
+ * Finish this frame. Resume the program until the current frame is finished.
587
+ * `fin[ish] <n>`
588
+ * Finish `<n>`th frames.
589
+ * `u[ntil]`
590
+ * Similar to `next` command, but only stop later lines or the end of the current frame.
591
+ * Similar to gdb's `advance` command.
592
+ * `u[ntil] <[file:]line>`
593
+ * Run til the program reaches given location or the end of the current frame.
594
+ * `u[ntil] <name>`
595
+ * Run til the program invokes a method `<name>`. `<name>` can be a regexp with `/name/`.
596
+ * `c` or `cont` or `continue`
597
+ * Resume the program.
598
+ * `q[uit]` or `Ctrl-D`
599
+ * Finish debugger (with the debuggee process on non-remote debugging).
600
+ * `q[uit]!`
601
+ * Same as q[uit] but without the confirmation prompt.
602
+ * `kill`
603
+ * Stop the debuggee process with `Kernel#exit!`.
604
+ * `kill!`
605
+ * Same as kill but without the confirmation prompt.
606
+ * `sigint`
607
+ * Execute SIGINT handler registered by the debuggee.
608
+ * Note that this command should be used just after stop by `SIGINT`.
609
+
610
+ ### Breakpoint
611
+
612
+ * `b[reak]`
613
+ * Show all breakpoints.
614
+ * `b[reak] <line>`
615
+ * Set breakpoint on `<line>` at the current frame's file.
616
+ * `b[reak] <file>:<line>` or `<file> <line>`
617
+ * Set breakpoint on `<file>:<line>`.
618
+ * `b[reak] <class>#<name>`
619
+ * Set breakpoint on the method `<class>#<name>`.
620
+ * `b[reak] <expr>.<name>`
621
+ * Set breakpoint on the method `<expr>.<name>`.
622
+ * `b[reak] ... if: <expr>`
623
+ * break if `<expr>` is true at specified location.
624
+ * `b[reak] ... pre: <command>`
625
+ * break and run `<command>` before stopping.
626
+ * `b[reak] ... do: <command>`
627
+ * break and run `<command>`, and continue.
628
+ * `b[reak] ... path: <path>`
629
+ * break if the path matches to `<path>`. `<path>` can be a regexp with `/regexp/`.
630
+ * `b[reak] if: <expr>`
631
+ * break if: `<expr>` is true at any lines.
632
+ * Note that this feature is super slow.
633
+ * `catch <Error>`
634
+ * Set breakpoint on raising `<Error>`.
635
+ * `catch ... if: <expr>`
636
+ * stops only if `<expr>` is true as well.
637
+ * `catch ... pre: <command>`
638
+ * runs `<command>` before stopping.
639
+ * `catch ... do: <command>`
640
+ * stops and run `<command>`, and continue.
641
+ * `catch ... path: <path>`
642
+ * stops if the exception is raised from a `<path>`. `<path>` can be a regexp with `/regexp/`.
643
+ * `watch @ivar`
644
+ * Stop the execution when the result of current scope's `@ivar` is changed.
645
+ * Note that this feature is super slow.
646
+ * `watch ... if: <expr>`
647
+ * stops only if `<expr>` is true as well.
648
+ * `watch ... pre: <command>`
649
+ * runs `<command>` before stopping.
650
+ * `watch ... do: <command>`
651
+ * stops and run `<command>`, and continue.
652
+ * `watch ... path: <path>`
653
+ * stops if the path matches `<path>`. `<path>` can be a regexp with `/regexp/`.
654
+ * `del[ete]`
655
+ * delete all breakpoints.
656
+ * `del[ete] <bpnum>`
657
+ * delete specified breakpoint.
658
+
659
+ ### Information
660
+
661
+ * `bt` or `backtrace`
662
+ * Show backtrace (frame) information.
663
+ * `bt <num>` or `backtrace <num>`
664
+ * Only shows first `<num>` frames.
665
+ * `bt /regexp/` or `backtrace /regexp/`
666
+ * Only shows frames with method name or location info that matches `/regexp/`.
667
+ * `bt <num> /regexp/` or `backtrace <num> /regexp/`
668
+ * Only shows first `<num>` frames with method name or location info that matches `/regexp/`.
669
+ * `l[ist]`
670
+ * Show current frame's source code.
671
+ * Next `list` command shows the successor lines.
672
+ * `l[ist] -`
673
+ * Show predecessor lines as opposed to the `list` command.
674
+ * `l[ist] <start>` or `l[ist] <start>-<end>`
675
+ * Show current frame's source code from the line <start> to <end> if given.
676
+ * `whereami`
677
+ * Show the current frame with source code.
678
+ * `edit`
679
+ * Open the current file on the editor (use `EDITOR` environment variable).
680
+ * Note that edited file will not be reloaded.
681
+ * `edit <file>`
682
+ * Open <file> on the editor.
683
+ * `i[nfo]`
684
+ * Show information about current frame (local/instance variables and defined constants).
685
+ * `i[nfo]` <subcommand>
686
+ * `info` has the following sub-commands.
687
+ * Sub-commands can be specified with few letters which is unambiguous, like `l` for 'locals'.
688
+ * `i[nfo] l or locals or local_variables`
689
+ * Show information about the current frame (local variables)
690
+ * It includes `self` as `%self` and a return value as `_return`.
691
+ * `i[nfo] i or ivars or instance_variables`
692
+ * Show information about instance variables about `self`.
693
+ * `info ivars <expr>` shows the instance variables of the result of `<expr>`.
694
+ * `i[nfo] c or consts or constants`
695
+ * Show information about accessible constants except toplevel constants.
696
+ * `info consts <expr>` shows the constants of a class/module of the result of `<expr>`
697
+ * `i[nfo] g or globals or global_variables`
698
+ * Show information about global variables
699
+ * `i[nfo] th or threads`
700
+ * Show all threads (same as `th[read]`).
701
+ * `i[nfo] b or breakpoints or w or watchpoints`
702
+ * Show all breakpoints and watchpoints.
703
+ * `i[nfo] ... /regexp/`
704
+ * Filter the output with `/regexp/`.
705
+ * `o[utline]` or `ls`
706
+ * Show you available methods, constants, local variables, and instance variables in the current scope.
707
+ * `o[utline] <expr>` or `ls <expr>`
708
+ * Show you available methods and instance variables of the given object.
709
+ * If the object is a class/module, it also lists its constants.
710
+ * `display`
711
+ * Show display setting.
712
+ * `display <expr>`
713
+ * Show the result of `<expr>` at every suspended timing.
714
+ * `undisplay`
715
+ * Remove all display settings.
716
+ * `undisplay <displaynum>`
717
+ * Remove a specified display setting.
718
+
719
+ ### Frame control
720
+
721
+ * `f[rame]`
722
+ * Show the current frame.
723
+ * `f[rame] <framenum>`
724
+ * Specify a current frame. Evaluation are run on specified frame.
725
+ * `up`
726
+ * Specify the upper frame.
727
+ * `down`
728
+ * Specify the lower frame.
729
+
730
+ ### Evaluate
731
+
732
+ * `p <expr>`
733
+ * Evaluate like `p <expr>` on the current frame.
734
+ * `pp <expr>`
735
+ * Evaluate like `pp <expr>` on the current frame.
736
+ * `eval <expr>`
737
+ * Evaluate `<expr>` on the current frame.
738
+ * `irb`
739
+ * Activate and switch to `irb:rdbg` console
740
+
741
+ ### Trace
742
+
743
+ * `trace`
744
+ * Show available tracers list.
745
+ * `trace line`
746
+ * Add a line tracer. It indicates line events.
747
+ * `trace call`
748
+ * Add a call tracer. It indicate call/return events.
749
+ * `trace exception`
750
+ * Add an exception tracer. It indicates raising exceptions.
751
+ * `trace object <expr>`
752
+ * Add an object tracer. It indicates that an object by `<expr>` is passed as a parameter or a receiver on method call.
753
+ * `trace ... /regexp/`
754
+ * Indicates only matched events to `/regexp/`.
755
+ * `trace ... into: <file>`
756
+ * Save trace information into: `<file>`.
757
+ * `trace off <num>`
758
+ * Disable tracer specified by `<num>` (use `trace` command to check the numbers).
759
+ * `trace off [line|call|pass]`
760
+ * Disable all tracers. If `<type>` is provided, disable specified type tracers.
761
+ * `record`
762
+ * Show recording status.
763
+ * `record [on|off]`
764
+ * Start/Stop recording.
765
+ * `step back`
766
+ * Start replay. Step back with the last execution log.
767
+ * `s[tep]` does stepping forward with the last log.
768
+ * `step reset`
769
+ * Stop replay .
770
+
771
+ ### Thread control
772
+
773
+ * `th[read]`
774
+ * Show all threads.
775
+ * `th[read] <thnum>`
776
+ * Switch thread specified by `<thnum>`.
777
+
778
+ ### Configuration
779
+
780
+ * `config`
781
+ * Show all configuration with description.
782
+ * `config <name>`
783
+ * Show current configuration of <name>.
784
+ * `config set <name> <val>` or `config <name> = <val>`
785
+ * Set <name> to <val>.
786
+ * `config append <name> <val>` or `config <name> << <val>`
787
+ * Append `<val>` to `<name>` if it is an array.
788
+ * `config unset <name>`
789
+ * Set <name> to default.
790
+ * `source <file>`
791
+ * Evaluate lines in `<file>` as debug commands.
792
+ * `open`
793
+ * open debuggee port on UNIX domain socket and wait for attaching.
794
+ * Note that `open` command is EXPERIMENTAL.
795
+ * `open [<host>:]<port>`
796
+ * open debuggee port on TCP/IP with given `[<host>:]<port>` and wait for attaching.
797
+ * `open vscode`
798
+ * open debuggee port for VSCode and launch VSCode if available.
799
+ * `open chrome`
800
+ * open debuggee port for Chrome and wait for attaching.
801
+
802
+ ### Help
803
+
804
+ * `h[elp]`
805
+ * Show help for all commands.
806
+ * `h[elp] <command>`
807
+ * Show help for the given command.
808
+
809
+
810
+ ### Using IRB as the Debug Console
811
+
812
+ Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:
813
+
814
+ * Autocompletion
815
+ * Support for multi-line input
816
+ * Access to commands not available in `debug`, like `show_source` or `show_doc`
817
+ * [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)
818
+
819
+ To switch to the IRB console, simply use the `irb` command in the debug console.
820
+
821
+ Once activated, you'll notice the prompt changes to:
822
+
823
+ ```console
824
+ irb:rdbg(main):001>
825
+ ```
826
+
827
+ If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:
828
+
829
+ * Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
830
+ * Or adding `config set irb_console 1` to your `~/.rdbgrc`
831
+
832
+ To disable the IRB console in the current session, execute `config set irb_console 0` in the console.
833
+
834
+ ## Debugger API
835
+
836
+ ### Start debugging
837
+
838
+ #### Start by requiring a library
839
+
840
+ You can start debugging without `rdbg` command by requiring the following libraries:
841
+
842
+ * `require 'debug'`: Same as `rdbg --nonstop --no-sigint-hook`.
843
+ * `require 'debug/start'`: Same as `rdbg`.
844
+ * `require 'debug/open'`: Same as `rdbg --open`.
845
+ * `require 'debug/open_nonstop'`: Same as `rdbg --open --nonstop`.
846
+
847
+ You need to require one of them at the very beginning of the application.
848
+ Using `ruby -r` (for example `ruby -r debug/start target.rb`) is another way to invoke with debugger.
849
+
850
+ NOTE: Until Ruby 3.0, there is old `lib/debug.rb` in the standard library.
851
+ `lib/debug.rb` was not maintained well in recent years, and the purpose of this library is to rewrite old `lib/debug.rb` with recent techniques.
852
+
853
+ So, if this gem is not installed, or if the `Gemfile` doesn't include this gem and `bundle exec` is used, you will see the following output:
854
+
855
+ ```console
856
+ $ ruby -r debug -e0
857
+ .../2.7.3/lib/ruby/2.7.0/x86_64-linux/continuation.so: warning: callcc is obsolete; use Fiber instead
858
+ Debug.rb
859
+ Emacs support available.
860
+
861
+ .../2.7.3/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:162: if RUBYGEMS_ACTIVATION_MONITOR.respond_to?(:mon_owned?)
862
+ (rdb:1)
863
+ ```
864
+
865
+ #### Start by method
866
+
867
+ After loading `debug/session`, you can start a debug session with the following methods.
868
+ They are convenient if you want to specify debug configurations in your program.
869
+
870
+ * `DEBUGGER__.start(**kw)`: start debug session with local console.
871
+ * `DEBUGGER__.open(**kw)`: open debug port with configuration (without configurations open with UNIX domain socket).
872
+ * `DEBUGGER__.open_unix(**kw)`: open debug port with UNIX domain socket.
873
+ * `DEBUGGER__.open_tcp(**kw)`: open debug port with TCP/IP.
874
+
875
+ For example:
876
+
877
+ ```ruby
878
+ require 'debug/session'
879
+ DEBUGGER__.start(no_color: true, # disable colorize
880
+ log_level: 'INFO') # Change log_level to INFO
881
+
882
+ ... # your application code
883
+ ```
884
+
885
+ ### `binding.break` method
886
+
887
+ `binding.break` (or `binding.b`) sets a breakpoint at that line.
888
+ It also has several keywords.
889
+
890
+ If `do: 'command'` is specified, the debugger suspends the program, runs the `command` as a debug command, and continues the program.
891
+ It is useful if you only want to call a debug command and don't want to stop there.
892
+ For example:
893
+
894
+ ```ruby
895
+ def initialize
896
+ @a = 1
897
+ binding.b do: 'info \n watch @a'
898
+ end
899
+ ```
900
+
901
+ In this case, execute the `info` command, then register a watch breakpoint for `@a` and continue to run.
902
+ You can also use `;;` instead of `\n` to separate your commands.
903
+
904
+ If `pre: 'command'` is specified, the debugger suspends the program and runs the `command` as a debug command, and keeps suspended.
905
+ It is useful if you have operations before suspend.
906
+ For example:
907
+
908
+ ```ruby
909
+ def foo
910
+ binding.b pre: 'p bar()'
911
+ ...
912
+ end
913
+ ```
914
+
915
+ In this case, you can see the result of `bar()` every time you stop there.
916
+
917
+ ## rdbg command help
918
+
919
+ ```console
920
+ exe/rdbg [options] -- [debuggee options]
921
+
922
+ Debug console mode:
923
+ -n, --nonstop Do not stop at the beginning of the script.
924
+ -e DEBUG_COMMAND Execute debug command at the beginning of the script.
925
+ -x, --init-script=FILE Execute debug command in the FILE.
926
+ --no-rc Ignore ~/.rdbgrc
927
+ --no-color Disable colorize
928
+ --no-sigint-hook Disable to trap SIGINT
929
+ -c, --command Enable command mode.
930
+ The first argument should be a command name in $PATH.
931
+ Example: 'rdbg -c bundle exec rake test'
932
+
933
+ -O, --open=[FRONTEND] Start remote debugging with opening the network port.
934
+ If TCP/IP options are not given, a UNIX domain socket will be used.
935
+ If FRONTEND is given, prepare for the FRONTEND.
936
+ Now rdbg, vscode and chrome is supported.
937
+ --sock-path=SOCK_PATH UNIX Domain socket path
938
+ --port=PORT Listening TCP/IP port
939
+ --port-range=PORT_RANGE Number of ports to try to connect to
940
+ --host=HOST Listening TCP/IP host
941
+ --cookie=COOKIE Set a cookie for connection
942
+ --session-name=NAME Session name
943
+
944
+ Debug console mode runs Ruby program with the debug console.
945
+
946
+ 'rdbg target.rb foo bar' starts like 'ruby target.rb foo bar'.
947
+ 'rdbg -- -r foo -e bar' starts like 'ruby -r foo -e bar'.
948
+ 'rdbg -c rake test' starts like 'rake test'.
949
+ 'rdbg -c -- rake test -t' starts like 'rake test -t'.
950
+ 'rdbg -c bundle exec rake test' starts like 'bundle exec rake test'.
951
+ 'rdbg -O target.rb foo bar' starts and accepts attaching with UNIX domain socket.
952
+ 'rdbg -O --port 1234 target.rb foo bar' starts accepts attaching with TCP/IP localhost:1234.
953
+ 'rdbg -O --port 1234 -- -r foo -e bar' starts accepts attaching with TCP/IP localhost:1234.
954
+ 'rdbg target.rb -O chrome --port 1234' starts and accepts connecting from Chrome Devtools with localhost:1234.
955
+
956
+ Attach mode:
957
+ -A, --attach Attach to debuggee process.
958
+
959
+ Attach mode attaches the remote debug console to the debuggee process.
960
+
961
+ 'rdbg -A' tries to connect via UNIX domain socket.
962
+ If there are multiple processes are waiting for the
963
+ debugger connection, list possible debuggee names.
964
+ 'rdbg -A path' tries to connect via UNIX domain socket with given path name.
965
+ 'rdbg -A port' tries to connect to localhost:port via TCP/IP.
966
+ 'rdbg -A host port' tries to connect to host:port via TCP/IP.
967
+
968
+ Other options:
969
+ -v Show version number
970
+ --version Show version number and exit
971
+ -h, --help Print help
972
+ --util=NAME Utility mode (used by tools)
973
+ --stop-at-load Stop immediately when the debugging feature is loaded.
974
+
975
+ NOTE
976
+ All messages communicated between a debugger and a debuggee are *NOT* encrypted.
977
+ Please use the remote debugging feature carefully.
978
+
979
+ ```
980
+
981
+ # Additional Resources
982
+
983
+ - [From byebug to ruby/debug](https://st0012.dev/from-byebug-to-ruby-debug) by Stan Lo - A migration guide for `byebug` users.
984
+ - [ruby/debug cheatsheet](https://st0012.dev/ruby-debug-cheatsheet) by Stan Lo
985
+
986
+ # Contributing
987
+
988
+ Bug reports and pull requests are welcome on GitHub at [https://github.com/ruby/debug]().
989
+ This debugger is not mature so your feedback will help us.
990
+
991
+ Please also check the [contributing guideline](/CONTRIBUTING.md).
992
+
993
+ # Acknowledgement
994
+
995
+ * Some tests are based on [deivid-rodriguez/byebug: Debugging in Ruby 2](https://github.com/deivid-rodriguez/byebug)
996
+ * Several codes in `server_cdp.rb` are based on [geoffreylitt/ladybug: Visual Debugger](https://github.com/geoffreylitt/ladybug)