Skip to content

Commit

Permalink
Remove prefix and add session_name
Browse files Browse the repository at this point in the history
  • Loading branch information
andyjeffries committed Oct 11, 2023
1 parent 5ce9b5e commit a6570c6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
28 changes: 13 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ New debug.rb has several advantages:
# Installation

```
$ gem install debug
gem install debug
```

or specify `-Ipath/to/debug/lib` in `RUBYOPT` or each ruby command-line option, especially for debug this gem development.
Expand Down Expand Up @@ -71,8 +71,8 @@ If you can modify the source code, you can use the debugger by adding `require '

You can also use its 2 aliases in the same way:

- `binding.b`
- `debugger`
* `binding.b`
* `debugger`

After that, run the program as usual and you will enter the debug console at breakpoints you inserted.

Expand Down Expand Up @@ -248,6 +248,7 @@ If you want to run a command written in Ruby like like `rake`, `rails`, `bundle`
* With `-c` option, `rdbg -c <name>` means that `<name>` is command in `PATH` and simply invoke it with the debugger.

Examples:

* `rdbg -c -- rails server`
* `rdbg -c -- bundle exec ruby foo.rb`
* `rdbg -c -- bundle exec rake test`
Expand Down Expand Up @@ -335,7 +336,7 @@ If you want to use TCP/IP for the remote debugging, you need to specify the port
To connect to the debuggee, you need to specify the port.

```shell
$ rdbg --attach 12345
rdbg --attach 12345
```

If you want to choose the host to bind, you can use `--host` option.
Expand All @@ -353,15 +354,15 @@ Please use it carefully.
By default, UNIX domain socket is used for the debugging port. To use TCP/IP, you can set the `RUBY_DEBUG_PORT` environment variable.

```shell
$ RUBY_DEBUG_PORT=12345 ruby target.rb
RUBY_DEBUG_PORT=12345 ruby target.rb
```

### Integration with external debugger frontend

You can attach with external debugger frontend with VSCode and Chrome.

```
$ rdbg --open=[frontend] target.rb
rdbg --open=[frontend] target.rb
```

will open a debug port and `[frontend]` can attach to the port.
Expand Down Expand Up @@ -464,8 +465,6 @@ config set log_level INFO
config set no_color true
```



* UI
* `RUBY_DEBUG_LOG_LEVEL` (`log_level`): Log level same as Logger (default: WARN)
* `RUBY_DEBUG_SHOW_SRC_LINES` (`show_src_lines`): Show n lines source code on breakpoint (default: 10)
Expand Down Expand Up @@ -502,7 +501,7 @@ config set no_color true
* `RUBY_DEBUG_SOCK_PATH` (`sock_path`): UNIX Domain Socket remote debugging: socket path
* `RUBY_DEBUG_SOCK_DIR` (`sock_dir`): UNIX Domain Socket remote debugging: socket directory
* `RUBY_DEBUG_SOCK_PREFIX` (`sock_prefix`): UNIX Domain Socket remote debugging: socket prefix
* `RUBY_DEBUG_SOCK_SUFFIX` (`sock_suffix`): UNIX Domain Socket remote debugging: socket suffix
* `RUBY_DEBUG_SESSION_NAME` (`session_name`): UNIX Domain Socket remote debugging: session name
* `RUBY_DEBUG_LOCAL_FS_MAP` (`local_fs_map`): Specify local fs map
* `RUBY_DEBUG_SKIP_BP` (`skip_bp`): Skip breakpoints if no clients are attached (default: false)
* `RUBY_DEBUG_COOKIE` (`cookie`): Cookie for negotiation
Expand Down Expand Up @@ -593,9 +592,9 @@ The `<...>` notation means the argument.
* `b[reak] <file>:<line>` or `<file> <line>`
* Set breakpoint on `<file>:<line>`.
* `b[reak] <class>#<name>`
* Set breakpoint on the method `<class>#<name>`.
* Set breakpoint on the method `<class>#<name>`.
* `b[reak] <expr>.<name>`
* Set breakpoint on the method `<expr>.<name>`.
* Set breakpoint on the method `<expr>.<name>`.
* `b[reak] ... if: <expr>`
* break if `<expr>` is true at specified location.
* `b[reak] ... pre: <command>`
Expand Down Expand Up @@ -783,7 +782,6 @@ The `<...>` notation means the argument.
* `h[elp] <command>`
* Show help for the given command.


## Debugger API

### Start debugging
Expand Down Expand Up @@ -925,12 +923,12 @@ NOTE
# Additional Resources
- [From byebug to ruby/debug](https://st0012.dev/from-byebug-to-ruby-debug) by Stan Lo - A migration guide for `byebug` users.
- [ruby/debug cheatsheet](https://st0012.dev/ruby-debug-cheatsheet) by Stan Lo
* [From byebug to ruby/debug](https://st0012.dev/from-byebug-to-ruby-debug) by Stan Lo - A migration guide for `byebug` users.
* [ruby/debug cheatsheet](https://st0012.dev/ruby-debug-cheatsheet) by Stan Lo
# Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/debug.
Bug reports and pull requests are welcome on GitHub at <https://github.com/ruby/debug>.
This debugger is not mature so your feedback will help us.
Please also check the [contributing guideline](/CONTRIBUTING.md).
Expand Down
2 changes: 1 addition & 1 deletion lib/debug/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ module DEBUGGER__
host: ['RUBY_DEBUG_HOST', "REMOTE: TCP/IP remote debugging: host", :string, "127.0.0.1"],
sock_path: ['RUBY_DEBUG_SOCK_PATH', "REMOTE: UNIX Domain Socket remote debugging: socket path"],
sock_dir: ['RUBY_DEBUG_SOCK_DIR', "REMOTE: UNIX Domain Socket remote debugging: socket directory"],
sock_suffix: ['RUBY_DEBUG_SOCK_SUFFIX', "REMOTE: UNIX Domain Socket remote debugging: socket suffix"],
sock_prefix: ['RUBY_DEBUG_SOCK_PREFIX', "REMOTE: UNIX Domain Socket remote debugging: socket prefix"],
session_name: ['RUBY_DEBUG_SESSION_NAME', "REMOTE: UNIX Domain Socket remote debugging: session name"],
local_fs_map: ['RUBY_DEBUG_LOCAL_FS_MAP', "REMOTE: Specify local fs map", :path_map],
skip_bp: ['RUBY_DEBUG_SKIP_BP', "REMOTE: Skip breakpoints if no clients are attached", :bool, 'false'],
cookie: ['RUBY_DEBUG_COOKIE', "REMOTE: Cookie for negotiation"],
Expand Down

0 comments on commit a6570c6

Please sign in to comment.