<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/irb/debug.rb, branch v3_4_9</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/irb] Load history when starting a direct debug session</title>
<updated>2024-12-12T17:26:06+00:00</updated>
<author>
<name>James Reid-Smith</name>
<email>james.reidsmith@shopify.com</email>
</author>
<published>2024-12-12T17:26:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c0caf1cc1aaa3ba2e9d09977ee2a51e35114c70f'/>
<id>c0caf1cc1aaa3ba2e9d09977ee2a51e35114c70f</id>
<content type='text'>
(https://github.com/ruby/irb/pull/1046)

* Load history when starting a direct debug session

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.

Fixes ruby/irb#975

* Update test/irb/test_history.rb

* Update lib/irb/debug.rb

---------

https://github.com/ruby/irb/commit/7f851b5353

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/1046)

* Load history when starting a direct debug session

When starting a debug session directly with RUBY_DEBUG_IRB_CONSOLE=1 and
`require 'debug'; debugger`, IRB's history wasn't loaded. This commit ensures
history is loaded in this case by calling `load_history` when configuring IRB
for the debugger.

Fixes ruby/irb#975

* Update test/irb/test_history.rb

* Update lib/irb/debug.rb

---------

https://github.com/ruby/irb/commit/7f851b5353

Co-authored-by: Stan Lo &lt;stan001212@gmail.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Fix debug command in nomultiline mode</title>
<updated>2024-09-20T10:13:39+00:00</updated>
<author>
<name>tomoya ishida</name>
<email>tomoyapenguin@gmail.com</email>
</author>
<published>2024-09-20T10:13:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=34e008d0756a355e0658f9b52f7d66b4b8eee388'/>
<id>34e008d0756a355e0658f9b52f7d66b4b8eee388</id>
<content type='text'>
(https://github.com/ruby/irb/pull/1006)

* Fix debug command in nomultiline mode

* context.colorize_code -&gt; context.colorize_input

https://github.com/ruby/irb/commit/71f4d6bfb5
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/1006)

* Fix debug command in nomultiline mode

* context.colorize_code -&gt; context.colorize_input

https://github.com/ruby/irb/commit/71f4d6bfb5
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Hide debugger hint after the input is submitted</title>
<updated>2023-11-27T10:34:40+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-11-27T10:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=a07d84b63c7785f6f1a0c5f6933c0b7fa87df1d8'/>
<id>a07d84b63c7785f6f1a0c5f6933c0b7fa87df1d8</id>
<content type='text'>
(https://github.com/ruby/irb/pull/789)

If `output_modifier_proc`'s `complete` arg is true, it means the input is
submitted. In that case, debugger hint doesn't provide value to users
and adds noise to the output. So we hide it in such case.

https://github.com/ruby/irb/commit/f86d9dbe2f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/789)

If `output_modifier_proc`'s `complete` arg is true, it means the input is
submitted. In that case, debugger hint doesn't provide value to users
and adds noise to the output. So we hide it in such case.

https://github.com/ruby/irb/commit/f86d9dbe2f
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Hint debugger command in irb:rdbg session</title>
<updated>2023-11-23T07:29:12+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-11-23T07:29:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e8b905896482f2952ccbb4d5bf0a1910edd07bf9'/>
<id>e8b905896482f2952ccbb4d5bf0a1910edd07bf9</id>
<content type='text'>
(https://github.com/ruby/irb/pull/768)

When user enters irb:rdbg session, they don't get the same hint that the
`debug` gem provides, like

```
(rdbg) n    # next command
```

This means that users may accidentally execute commands when they want to
retrieve the value of a variable.

So this commit adds a Reline output modifier to add a simiar hint:

```
irb:rdbg(main):002&gt; n # debug command
```

It is not exactly the same as `debug`'s because in this case the importance
is to help users distinguish between value evaluation and debugger command
execution.

https://github.com/ruby/irb/commit/fdf24de851
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/768)

When user enters irb:rdbg session, they don't get the same hint that the
`debug` gem provides, like

```
(rdbg) n    # next command
```

This means that users may accidentally execute commands when they want to
retrieve the value of a variable.

So this commit adds a Reline output modifier to add a simiar hint:

```
irb:rdbg(main):002&gt; n # debug command
```

It is not exactly the same as `debug`'s because in this case the importance
is to help users distinguish between value evaluation and debugger command
execution.

https://github.com/ruby/irb/commit/fdf24de851
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Avoid locking the debug UI to a single thread</title>
<updated>2023-10-11T14:16:39+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-10-11T14:16:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=cc311e1c4599200dd7437cd578e61c83067e555c'/>
<id>cc311e1c4599200dd7437cd578e61c83067e555c</id>
<content type='text'>
(https://github.com/ruby/irb/pull/725)

Since `debug` stores and updates the target thread via its Session's
`@tc` variable, we don't need to and shouldn't lock the UI to the thread
that activates the integration.

https://github.com/ruby/irb/commit/202efdbf0c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/725)

Since `debug` stores and updates the target thread via its Session's
`@tc` variable, we don't need to and shouldn't lock the UI to the thread
that activates the integration.

https://github.com/ruby/irb/commit/202efdbf0c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] irb:rdbg cleanups (https://github.com/ruby/irb/pull/697)</title>
<updated>2023-08-29T12:54:25+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-08-29T12:54:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6ed1a504d49af09aac543ef39facaa11639add7e'/>
<id>6ed1a504d49af09aac543ef39facaa11639add7e</id>
<content type='text'>
* Remove unused method and constant from IRB::Debug

* Update comments

https://github.com/ruby/irb/commit/98914a963c
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Remove unused method and constant from IRB::Debug

* Update comments

https://github.com/ruby/irb/commit/98914a963c
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Avoid overriding user's `irb_name` setting in debugger</title>
<updated>2023-08-21T18:23:32+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-08-21T18:23:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=ca6db02c2a305bc990c144439996abfe984a6c5a'/>
<id>ca6db02c2a305bc990c144439996abfe984a6c5a</id>
<content type='text'>
integration
(https://github.com/ruby/irb/pull/688)

* Avoid overriding user's irb_name setting in debugger integration

Instead of always setting `irb_name` to `irb:rdbg`, it should respect
the user's setting and only append `:rdbg` to it.

* Introduce write_rc test helper

https://github.com/ruby/irb/commit/2ce7593351
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
integration
(https://github.com/ruby/irb/pull/688)

* Avoid overriding user's irb_name setting in debugger integration

Instead of always setting `irb_name` to `irb:rdbg`, it should respect
the user's setting and only append `:rdbg` to it.

* Introduce write_rc test helper

https://github.com/ruby/irb/commit/2ce7593351
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/irb] Support seamless integration with ruby/debug</title>
<updated>2023-08-13T18:30:34+00:00</updated>
<author>
<name>Stan Lo</name>
<email>stan001212@gmail.com</email>
</author>
<published>2023-08-13T18:30:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7f8f62c93bf3d11a0321fa91823065a2ff36f6d0'/>
<id>7f8f62c93bf3d11a0321fa91823065a2ff36f6d0</id>
<content type='text'>
(https://github.com/ruby/irb/pull/575)

* Support native integration with ruby/debug

* Prevent using multi-irb and activating debugger at the same time

Multi-irb makes a few assumptions:

- IRB will manage all threads that host sub-irb sessions
- All IRB sessions will be run on the threads created by IRB itself

However, when using the debugger these assumptions are broken:

- `debug` will freeze ALL threads when it suspends the session (e.g. when
  hitting a breakpoint, or performing step-debugging).
- Since the irb-debug integration runs IRB as the debugger's interface,
  it will be run on the debugger's thread, which is not managed by IRB.

So we should prevent the 2 features from being used at the same time.
To do that, we check if the other feature is already activated when
executing the commands that would activate the other feature.

https://github.com/ruby/irb/commit/d8fb3246be
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(https://github.com/ruby/irb/pull/575)

* Support native integration with ruby/debug

* Prevent using multi-irb and activating debugger at the same time

Multi-irb makes a few assumptions:

- IRB will manage all threads that host sub-irb sessions
- All IRB sessions will be run on the threads created by IRB itself

However, when using the debugger these assumptions are broken:

- `debug` will freeze ALL threads when it suspends the session (e.g. when
  hitting a breakpoint, or performing step-debugging).
- Since the irb-debug integration runs IRB as the debugger's interface,
  it will be run on the debugger's thread, which is not managed by IRB.

So we should prevent the 2 features from being used at the same time.
To do that, we check if the other feature is already activated when
executing the commands that would activate the other feature.

https://github.com/ruby/irb/commit/d8fb3246be
</pre>
</div>
</content>
</entry>
</feed>
