Your environment
ruby -v: ruby 3.3.0preview1 (2023-05-12 master a1b01e7701) [x86_64-darwin22]
rdbg -v: rdbg 1.8.0
Describe the bug
Broken command histories (both .irb_history and .rdbg_history), when I execute debugger on irb.
To Reproduce
-
Prepare a ruby script test.rb like this:
require "debug"
class Test
def run
debugger
end
end
-
Remove .irb_history and .rdbg_history to clean up
-
Run irb
-
Run the following commands on irb
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
-
Debugger started
-
Run the following commands on debugger console
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
-
Debugger finished (then I return to irb console)
-
Run quit to exit irb
-
Run irb again
-
Run the following commands on irb
puts "irb 7"
puts "irb 8"
puts "irb 9"
require "./test"
Test.new.run
-
Debugger started
-
Run the following commands on debugger console
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
-
Run quit to exit irb
-
Look at .irb_history and .rdbg_history
Actual behavior
I got:
[.irb_history]
Details
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
quit
puts "irb 7"
puts "irb 8"
puts "irb 9"
require "./test"
Test.new.run
# Today's OMIKUJI: CHU-KICHI
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
quit
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
quit
[.rdbg_history]
Details
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
quit
puts "irb 8"
puts "irb 9"
require "./test"
Test.new.run
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
quit
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
quit
Expected behavior
Both history .irb_history and .rdbg_history should have same contents:
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
quit
puts "irb 7"
puts "irb 8"
puts "irb 9"
require "./test"
Test.new.run
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
quit
I do not know where Today's OMIKUJI should appear at.
Additional context
This problem dose not appear with:
-
Remove .irb_history and .rdbg_history to clean up
-
Run irb
-
Run the following commands on irb
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
-
Debugger started
-
Run the following commands on debugger console
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
-
Debugger finished (then I return to irb console)
-
Do not exit irb console here!!!
-
Run the following commands on irb
puts "irb 7"
puts "irb 8"
puts "irb 9"
require "./test"
Test.new.run
-
Debugger started
-
Run the following commands on debugger console
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
-
Run quit to exit irb
-
Look at .irb_history and .rdbg_history
I got:
[.irb_history]
Details
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
puts "irb 7"
puts "irb 8"
puts "irb 9"
Test.new.run
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
quit
[.rdbg_history]
Details
require "./test"
puts "irb 1"
puts "irb 2"
puts "irb 3"
Test.new.run
puts "debug 4"
puts "debug 5"
puts "debug 6"
continue
puts "irb 7"
puts "irb 8"
puts "irb 9"
Test.new.run
puts "debug 10"
puts "debug 11"
puts "debug 12"
continue
quit
Your environment
ruby -v: ruby 3.3.0preview1 (2023-05-12 master a1b01e7701) [x86_64-darwin22]rdbg -v: rdbg 1.8.0Describe the bug
Broken command histories (both
.irb_historyand.rdbg_history), when I execute debugger on irb.To Reproduce
Prepare a ruby script
test.rblike this:Remove
.irb_historyand.rdbg_historyto clean upRun irb
Run the following commands on irb
Debugger started
Run the following commands on debugger console
Debugger finished (then I return to irb console)
Run quit to exit irb
Run irb again
Run the following commands on irb
Debugger started
Run the following commands on debugger console
Run quit to exit irb
Look at
.irb_historyand.rdbg_historyActual behavior
I got:
[.irb_history]
Details
[.rdbg_history]
Details
Expected behavior
Both history
.irb_historyand.rdbg_historyshould have same contents:I do not know where
Today's OMIKUJIshould appear at.Additional context
This problem dose not appear with:
Remove
.irb_historyand.rdbg_historyto clean upRun irb
Run the following commands on irb
Debugger started
Run the following commands on debugger console
Debugger finished (then I return to irb console)
Do not exit irb console here!!!
Run the following commands on irb
Debugger started
Run the following commands on debugger console
Run quit to exit irb
Look at
.irb_historyand.rdbg_historyI got:
[.irb_history]
Details
[.rdbg_history]
Details