ruby / irb

interactive Ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`irb` as _default_ `debug` front-end?

jon-sully opened this issue · comments

Description

Greetings! I've been playing with the new irb/debug integration that was recently released and overall the experience is really great. Having full irb context while being in a full debug session is really nice. The irb:rdbg prompt is easy to work with and simple — kudos! ☺️

I'm hoping we can improve the experience a bit though. My understanding is that right now the only way to properly enter this context/experience is to use binding.irb to halt the code, then once in that irb session, manually call debug.

After migrating to the debug gem after years of pry/byebug, it took some time for me to retrain my muscle memory for debugging to use debugger rather than binding.pry etc. but I've found that even with irb's new front-end integration working with the debug gem, the debugger still only loads the default debug front end. Is there any way that we could consolidate the whole experience such that simply using debugger drops into the full irb:rdbg session?

After chatting with the maintainer of debug, he agreed to make this interface part of the debug gem. The details are:

  • Its current REPL will still be preserved and be the default. But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)
  • When users use the irb command, it should open the irb:rdbg console instead of vanilla IRB
  • Remote debugging will not be supported at the beginning
  • But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)

Sweet!

Remote debugging will not be supported at the beginning

Fair 'nuff!

Any idea what the best way to follow this development is? Ready to upgrade my debug gem whenever that ships!

I've opened ruby/debug#1024 upstream to make its irb command opening up an irb:rdbg session. It could still take a while to polish before merging though.

Understandable! Thank you for this 🙏 I've been spending more time lately kicking into irb from a debug session now that I know how, and I vastly prefer it to the pure rdbg prompt

Woop woop! Out of curiosity, did ruby/debug#1024 include this functionality?

Its current REPL will still be preserved and be the default. But users can use irb:rdbg as the default REPL by setting a configuration (e.g. RUBY_DEBUG_IRB_CONSOLE=1)

@jon-sully Yes it does 😄