From 5eba4e922e4c7133d9fdfef4526254fda7156779 Mon Sep 17 00:00:00 2001 From: Takashi Kokubun Date: Wed, 6 Sep 2023 15:32:27 -0700 Subject: [PATCH 1/3] Stop assuming Integer#times is written in C --- test/console/backtrace_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/console/backtrace_test.rb b/test/console/backtrace_test.rb index 52b1238a1..dd1316ee5 100644 --- a/test/console/backtrace_test.rb +++ b/test/console/backtrace_test.rb @@ -22,7 +22,7 @@ def program 14| end 15| end 16| - 17| 3.times do + 17| [1, 2, 3].each do 18| Foo.new.first_call 19| end RUBY @@ -33,7 +33,7 @@ def test_backtrace_prints_c_method_frame type 'b 18' type 'c' type 'bt' - assert_line_text(/\[C\] Integer#times/) + assert_line_text(/\[C\] Array#each/) type 'kill!' end end From 3d0f4e3225c4f88db23b580fea6f391d33a178d8 Mon Sep 17 00:00:00 2001 From: Stan Lo Date: Thu, 14 Sep 2023 12:22:56 +0100 Subject: [PATCH 2/3] Require Reline 0.3.8+ to avoid frozen issue --- debug.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debug.gemspec b/debug.gemspec index f05d0faa7..a07018a77 100644 --- a/debug.gemspec +++ b/debug.gemspec @@ -28,5 +28,5 @@ Gem::Specification.new do |spec| spec.extensions = ['ext/debug/extconf.rb'] spec.add_dependency "irb", ">= 1.5.0" # for binding.irb(show_code: false) - spec.add_dependency "reline", ">= 0.3.1" + spec.add_dependency "reline", ">= 0.3.8" end From 3d822a1b8323ec354fbf0cb3ad365d882a04dd02 Mon Sep 17 00:00:00 2001 From: tompng Date: Sat, 5 Aug 2023 22:18:35 +0900 Subject: [PATCH 3/3] Fix prompt list size and colorized code line size to match input line size --- lib/debug/console.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/debug/console.rb b/lib/debug/console.rb index 2da261662..b44868899 100644 --- a/lib/debug/console.rb +++ b/lib/debug/console.rb @@ -56,10 +56,10 @@ def readline_setup prompt Reline.prompt_proc = -> args, *kw do case state = parse_input(args.first, commands) when nil, :command - [prompt, prompt] + [prompt] when :ruby - [prompt.sub('rdbg'){colorize('ruby', [:RED])}] * 2 - end + [prompt.sub('rdbg'){colorize('ruby', [:RED])}] + end * args.size end Reline.completion_proc = -> given do @@ -96,7 +96,7 @@ def readline_setup prompt when nil buff when :ruby - colorize_code(buff.chomp) + colorize_code(buff) end end unless CONFIG[:no_hint]