@@ -31,7 +31,7 @@ New debug.rb has several advantages:
31
31
# Installation
32
32
33
33
```
34
- $ gem install debug
34
+ gem install debug
35
35
```
36
36
37
37
or specify ` -Ipath/to/debug/lib ` in ` RUBYOPT ` or each ruby command-line option, especially for debug this gem development.
@@ -71,8 +71,8 @@ If you can modify the source code, you can use the debugger by adding `require '
71
71
72
72
You can also use its 2 aliases in the same way:
73
73
74
- - ` binding.b `
75
- - ` debugger `
74
+ * ` binding.b `
75
+ * ` debugger `
76
76
77
77
After that, run the program as usual and you will enter the debug console at breakpoints you inserted.
78
78
@@ -248,6 +248,7 @@ If you want to run a command written in Ruby like like `rake`, `rails`, `bundle`
248
248
* With ` -c ` option, ` rdbg -c <name> ` means that ` <name> ` is command in ` PATH ` and simply invoke it with the debugger.
249
249
250
250
Examples:
251
+
251
252
* ` rdbg -c -- rails server `
252
253
* ` rdbg -c -- bundle exec ruby foo.rb `
253
254
* ` rdbg -c -- bundle exec rake test `
@@ -335,7 +336,7 @@ If you want to use TCP/IP for the remote debugging, you need to specify the port
335
336
To connect to the debuggee, you need to specify the port.
336
337
337
338
``` shell
338
- $ rdbg --attach 12345
339
+ rdbg --attach 12345
339
340
```
340
341
341
342
If you want to choose the host to bind, you can use ` --host ` option.
@@ -353,15 +354,15 @@ Please use it carefully.
353
354
By default, UNIX domain socket is used for the debugging port. To use TCP/IP, you can set the ` RUBY_DEBUG_PORT ` environment variable.
354
355
355
356
``` shell
356
- $ RUBY_DEBUG_PORT=12345 ruby target.rb
357
+ RUBY_DEBUG_PORT=12345 ruby target.rb
357
358
```
358
359
359
360
### Integration with external debugger frontend
360
361
361
362
You can attach with external debugger frontend with VSCode and Chrome.
362
363
363
364
```
364
- $ rdbg --open=[frontend] target.rb
365
+ rdbg --open=[frontend] target.rb
365
366
```
366
367
367
368
will open a debug port and ` [frontend] ` can attach to the port.
@@ -464,8 +465,6 @@ config set log_level INFO
464
465
config set no_color true
465
466
```
466
467
467
-
468
-
469
468
* UI
470
469
* ` RUBY_DEBUG_LOG_LEVEL ` (` log_level ` ): Log level same as Logger (default: WARN)
471
470
* ` RUBY_DEBUG_SHOW_SRC_LINES ` (` show_src_lines ` ): Show n lines source code on breakpoint (default: 10)
@@ -502,7 +501,7 @@ config set no_color true
502
501
* ` RUBY_DEBUG_SOCK_PATH ` (` sock_path ` ): UNIX Domain Socket remote debugging: socket path
503
502
* ` RUBY_DEBUG_SOCK_DIR ` (` sock_dir ` ): UNIX Domain Socket remote debugging: socket directory
504
503
* ` RUBY_DEBUG_SOCK_PREFIX ` (` sock_prefix ` ): UNIX Domain Socket remote debugging: socket prefix
505
- * ` RUBY_DEBUG_SOCK_SUFFIX ` (` sock_suffix ` ): UNIX Domain Socket remote debugging: socket suffix
504
+ * ` RUBY_DEBUG_SESSION_NAME ` (` session_name ` ): UNIX Domain Socket remote debugging: session name
506
505
* ` RUBY_DEBUG_LOCAL_FS_MAP ` (` local_fs_map ` ): Specify local fs map
507
506
* ` RUBY_DEBUG_SKIP_BP ` (` skip_bp ` ): Skip breakpoints if no clients are attached (default: false)
508
507
* ` RUBY_DEBUG_COOKIE ` (` cookie ` ): Cookie for negotiation
@@ -593,9 +592,9 @@ The `<...>` notation means the argument.
593
592
* ` b[reak] <file>:<line> ` or ` <file> <line> `
594
593
* Set breakpoint on ` <file>:<line> ` .
595
594
* ` b[reak] <class>#<name> `
596
- * Set breakpoint on the method ` <class>#<name> ` .
595
+ * Set breakpoint on the method ` <class>#<name> ` .
597
596
* ` b[reak] <expr>.<name> `
598
- * Set breakpoint on the method ` <expr>.<name> ` .
597
+ * Set breakpoint on the method ` <expr>.<name> ` .
599
598
* ` b[reak] ... if: <expr> `
600
599
* break if ` <expr> ` is true at specified location.
601
600
* ` b[reak] ... pre: <command> `
@@ -783,7 +782,6 @@ The `<...>` notation means the argument.
783
782
* ` h[elp] <command> `
784
783
* Show help for the given command.
785
784
786
-
787
785
## Debugger API
788
786
789
787
### Start debugging
@@ -925,12 +923,12 @@ NOTE
925
923
926
924
# Additional Resources
927
925
928
- - [From byebug to ruby/debug](https://st0012.dev/from-byebug-to-ruby-debug) by Stan Lo - A migration guide for `byebug` users.
929
- - [ruby/debug cheatsheet](https://st0012.dev/ruby-debug-cheatsheet) by Stan Lo
926
+ * [From byebug to ruby/debug](https://st0012.dev/from-byebug-to-ruby-debug) by Stan Lo - A migration guide for `byebug` users.
927
+ * [ruby/debug cheatsheet](https://st0012.dev/ruby-debug-cheatsheet) by Stan Lo
930
928
931
929
# Contributing
932
930
933
- Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/debug.
931
+ Bug reports and pull requests are welcome on GitHub at < https://github.com/ruby/debug> .
934
932
This debugger is not mature so your feedback will help us.
935
933
936
934
Please also check the [contributing guideline](/CONTRIBUTING.md).
0 commit comments