Commit graph

9 commits

Author SHA1 Message Date
Stan Lo
7f8f62c93b [ruby/irb] Support seamless integration with ruby/debug
(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.

d8fb3246be
2023-08-13 18:30:34 +00:00
Takashi Kokubun
cf0b413ef8 [ruby/irb] Respect DLEXT to force-load debug.so
(https://github.com/ruby/irb/pull/481)

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-12-20 09:07:54 -08:00
Stan Lo
381e128c13 [ruby/irb] Fix step command (https://github.com/ruby/irb/pull/477)
The current `next` pre-command workaround on IRB source stepping
moves the location by 1 extra line. A better way is to make `debug`
skip IRB frames completely, which is what this commit does.

It also fixes the step command's test. The `|` in regexp was not escaped
so it was always incorrectly matched.
2022-12-09 23:39:17 +00:00
Stan Lo
3956bb859c [ruby/irb] Add "show_cmds" command to list all commands'
descriptions
(https://github.com/ruby/irb/pull/463)

7e857655ac
2022-12-08 19:10:23 +00:00
Takashi Kokubun
c5279db75f [ruby/irb] Fix the debug.gem force-loader for Ruby 3.2
(https://github.com/ruby/irb/pull/458)

* Fix the debug.gem force-loader for Ruby 3.2

* Support 1.7.0dev format as well
2022-11-28 18:42:59 +00:00
Takashi Kokubun
c9fbc779a6 [ruby/irb] Add commands to start and use the debugger
(https://github.com/ruby/irb/pull/449)

* Seamlessly integrate a few debug commands

* Improve the break command support

* Utilize skip_src option if available

* Add step and delete commands

* Write end-to-end tests for each debugger command

* Add documentation

* Add backtrace, info, catch commands

976100c1c2
2022-11-21 08:46:27 +00:00
Takashi Kokubun
ba3b40a9ae [ruby/irb] Discover and load debug.gem even if it's not in Gemfile
(https://github.com/ruby/irb/pull/448)

* Minor fixes on debug command

* Discover and load debug.gem even if it's not in Gemfile

* Eliminate else for rescue

* Discover the latest one from all gem paths
2022-11-18 18:03:33 +00:00
Takashi Kokubun
b1cbc883f2 [ruby/irb] Minor fixes on debug command
(https://github.com/ruby/irb/pull/447)

* Minor fixes on debug command

* Update lib/irb/cmd/debug.rb
2022-11-18 17:34:42 +00:00
Stan Lo
00872d120b [ruby/irb] Add debug command (https://github.com/ruby/irb/pull/446)
30faa13fa3
2022-11-18 09:11:23 +00:00