Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention IRB console in readme #1092

Merged
merged 2 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 32 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ New debug.rb has several advantages:
* TCP/IP
* Integration with rich debugger frontends

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) |
---|---|---|---|
Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |
| 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) |
| ----------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------- |
| Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
| Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |

* Extensible: application can introduce debugging support in several ways:
* By `rdbg` command
Expand Down Expand Up @@ -289,10 +289,10 @@ You can run your application as a remote debuggee, and the remote debugger conso

There are multiple ways to run your program as a debuggee:

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)
---|---|---|---|
Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open`
No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)`
| 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) |
| --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------- |
| Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open` |
| No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)` |

#### `rdbg --open` (or `rdbg -O` for short)

Expand Down Expand Up @@ -784,6 +784,30 @@ The `<...>` notation means the argument.
* Show help for the given command.


### Using IRB as the Debug Console

Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:

* Autocompletion
* Support for multi-line input
* Access to commands not available in `debug`, like `show_source` or `show_doc`
* [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)

To switch to the IRB console, simply use the `irb` command in the debug console.

Once activated, you'll notice the prompt changes to:

```txt
irb:rdbg(main):001>
```

If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:

* Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
* Or adding `config set irb_console 1` to your `~/.rdbgrc`

To disable the IRB console in the current session, execute `config set irb_console 0` in the console.

## Debugger API

### Start debugging
Expand Down
40 changes: 32 additions & 8 deletions misc/README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ New debug.rb has several advantages:
* TCP/IP
* Integration with rich debugger frontends

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) |
---|---|---|---|
Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |
| 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) |
| ----------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------- | --------------------------------------------- |
| Connection | UDS, TCP/IP | UDS, TCP/IP | TCP/IP |
| Requirement | No | [vscode-rdbg](https://marketplace.visualstudio.com/items?itemName=KoichiSasada.vscode-rdbg) | Chrome |

* Extensible: application can introduce debugging support in several ways:
* By `rdbg` command
Expand Down Expand Up @@ -289,10 +289,10 @@ You can run your application as a remote debuggee, and the remote debugger conso

There are multiple ways to run your program as a debuggee:

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)
---|---|---|---|
Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open`
No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)`
| 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) |
| --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------------------- |
| Yes | `rdbg --open` | `require "debug/open"` | `DEBUGGER__.open` |
| No | `rdbg --open --nonstop` | `require "debug/open_nonstop"` | `DEBUGGER__.open(nonstop: true)` |

#### `rdbg --open` (or `rdbg -O` for short)

Expand Down Expand Up @@ -509,6 +509,30 @@ The `<...>` notation means the argument.

<%= DEBUGGER__.help %>

### Using IRB as the Debug Console

Starting from version `v1.9`, you can now use IRB as the debug console. This integration brings additional features such as:

* Autocompletion
* Support for multi-line input
* Access to commands not available in `debug`, like `show_source` or `show_doc`
* [Configurable command aliases](https://docs.ruby-lang.org/en/master/IRB.html#module-IRB-label-Command+Aliases)

To switch to the IRB console, simply use the `irb` command in the debug console.

Once activated, you'll notice the prompt changes to:

```txt
irb:rdbg(main):001>
```

If you want to make IRB the default console for all sessions, configure the `irb_console` setting by either:

* Setting the `RUBY_DEBUG_IRB_CONSOLE=true` environment variable
* Or adding `config set irb_console 1` to your `~/.rdbgrc`

To disable the IRB console in the current session, execute `config set irb_console 0` in the console.

## Debugger API

### Start debugging
Expand Down
Loading