summaryrefslogtreecommitdiff
path: root/lib/irb/debug.rb
AgeCommit message (Collapse)Author
2025-01-24Migrate irb and reline to the bundled gemsHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/12624
2024-12-12[ruby/irb] Load history when starting a direct debug sessionJames Reid-Smith
(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 <stan001212@gmail.com>
2024-09-20[ruby/irb] Fix debug command in nomultiline modetomoya ishida
(https://github.com/ruby/irb/pull/1006) * Fix debug command in nomultiline mode * context.colorize_code -> context.colorize_input https://github.com/ruby/irb/commit/71f4d6bfb5
2023-11-27[ruby/irb] Hide debugger hint after the input is submittedStan Lo
(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
2023-11-23[ruby/irb] Hint debugger command in irb:rdbg sessionStan Lo
(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> 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
2023-10-11[ruby/irb] Avoid locking the debug UI to a single threadStan Lo
(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
2023-08-29[ruby/irb] irb:rdbg cleanups (https://github.com/ruby/irb/pull/697)Stan Lo
* Remove unused method and constant from IRB::Debug * Update comments https://github.com/ruby/irb/commit/98914a963c
2023-08-21[ruby/irb] Avoid overriding user's `irb_name` setting in debuggerStan Lo
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
2023-08-13[ruby/irb] Support seamless integration with ruby/debugStan Lo
(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