From 5b47f6aa8f7ec1d8e869ffcc249c83922a90e2e2 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Tue, 14 Nov 2023 17:22:56 +0900 Subject: [PATCH] Revert "Do not use HEAD request if 1 port" This reverts commit 6571e2a46b054c8c81dcefc19094eec1767462f9. It contains #1024 accidentally. --- .github/workflows/protocol.yml | 2 +- .github/workflows/ruby.yml | 2 +- README.md | 1 - debug.gemspec | 4 ++-- lib/debug/client.rb | 5 ++--- lib/debug/config.rb | 1 - lib/debug/session.rb | 5 ----- lib/debug/thread_client.rb | 9 +++++++-- test/support/console_test_case.rb | 1 - 9 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/protocol.yml b/.github/workflows/protocol.yml index 4225bd934..b2889aab1 100644 --- a/.github/workflows/protocol.yml +++ b/.github/workflows/protocol.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["2.7", "3.0", "3.1", "head", "debug"] + ruby-version: ['2.6', '2.7', '3.0', '3.1', 'head', 'debug'] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 8f8685665..a41da836a 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - ruby-version: ["2.7", "3.0", "3.1", "3.2", "head", "debug"] + ruby-version: ['2.6', '2.7', '3.0', '3.1', '3.2', 'head', 'debug'] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 6edabe520..c46a5d058 100644 --- a/README.md +++ b/README.md @@ -477,7 +477,6 @@ config set no_color true * `RUBY_DEBUG_NO_RELINE` (`no_reline`): Do not use Reline library (default: false) * `RUBY_DEBUG_NO_HINT` (`no_hint`): Do not show the hint on the REPL (default: false) * `RUBY_DEBUG_NO_LINENO` (`no_lineno`): Do not show line numbers (default: false) - * `RUBY_DEBUG_IRB_CONSOLE` (`irb_console`): Use IRB as the console (default: false) * CONTROL * `RUBY_DEBUG_SKIP_PATH` (`skip_path`): Skip showing/entering frames for given paths diff --git a/debug.gemspec b/debug.gemspec index 03ed0584f..a07018a77 100644 --- a/debug.gemspec +++ b/debug.gemspec @@ -10,7 +10,7 @@ Gem::Specification.new do |spec| spec.description = %q{Debugging functionality for Ruby. This is completely rewritten debug.rb which was contained by the ancient Ruby versions.} spec.homepage = "https://github.com/ruby/debug" spec.licenses = ["Ruby", "BSD-2-Clause"] - spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0") + spec.required_ruby_version = Gem::Requirement.new(">= 2.6.0") spec.metadata["homepage_uri"] = spec.homepage spec.metadata["source_code_uri"] = spec.homepage @@ -27,6 +27,6 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.extensions = ['ext/debug/extconf.rb'] - spec.add_dependency "irb", ">= 1.8.3" # for irb:debug integration + spec.add_dependency "irb", ">= 1.5.0" # for binding.irb(show_code: false) spec.add_dependency "reline", ">= 0.3.8" end diff --git a/lib/debug/client.rb b/lib/debug/client.rb index a801d3502..2d7d31b56 100644 --- a/lib/debug/client.rb +++ b/lib/debug/client.rb @@ -165,16 +165,15 @@ def connect_unix name = nil end else Client.cleanup_unix_domain_sockets - files = Client.list_connections + files = Client.list_connections verbose: true case files.size when 0 $stderr.puts "No debug session is available." exit when 1 - @s = Socket.unix(files.first) + @s = Socket.unix(files.first.first) else - files = Client.list_connections verbose: true $stderr.puts "Please select a debug session:" files.each{|(f, desc)| $stderr.puts " #{File.basename(f)} (#{desc})" diff --git a/lib/debug/config.rb b/lib/debug/config.rb index af557a0cf..f6f1a066d 100644 --- a/lib/debug/config.rb +++ b/lib/debug/config.rb @@ -22,7 +22,6 @@ module DEBUGGER__ no_reline: ['RUBY_DEBUG_NO_RELINE', "UI: Do not use Reline library", :bool, "false"], no_hint: ['RUBY_DEBUG_NO_HINT', "UI: Do not show the hint on the REPL", :bool, "false"], no_lineno: ['RUBY_DEBUG_NO_LINENO', "UI: Do not show line numbers", :bool, "false"], - irb_console: ["RUBY_DEBUG_IRB_CONSOLE", "UI: Use IRB as the console", :bool, "false"], # control setting skip_path: ['RUBY_DEBUG_SKIP_PATH', "CONTROL: Skip showing/entering frames for given paths", :path], diff --git a/lib/debug/session.rb b/lib/debug/session.rb index cb3e85fcd..3db2f45da 100644 --- a/lib/debug/session.rb +++ b/lib/debug/session.rb @@ -202,11 +202,6 @@ def activate ui = nil, on_fork: false end @tp_thread_end.enable - if CONFIG[:irb_console] - require_relative "irb_integration" - thc.activate_irb_integration - end - # session start q << true session_server_main diff --git a/lib/debug/thread_client.rb b/lib/debug/thread_client.rb index 6f9da4af1..3ec53fb81 100644 --- a/lib/debug/thread_client.rb +++ b/lib/debug/thread_client.rb @@ -1048,8 +1048,13 @@ def wait_next_action_ when :call result = frame_eval(eval_src) when :irb - require_relative "irb_integration" - activate_irb_integration + require 'irb' # prelude's binding.irb doesn't have show_code option + begin + result = frame_eval('binding.irb(show_code: false)', binding_location: true) + ensure + # workaround: https://github.com/ruby/debug/issues/308 + Reline.prompt_proc = nil if defined? Reline + end when :display, :try_display failed_results = [] eval_src.each_with_index{|src, i| diff --git a/test/support/console_test_case.rb b/test/support/console_test_case.rb index efdc1bafe..49e0bb87f 100644 --- a/test/support/console_test_case.rb +++ b/test/support/console_test_case.rb @@ -217,7 +217,6 @@ def prepare_test_environment(program, test_steps, &block) ENV['RUBY_DEBUG_TEST_UI'] = 'terminal' ENV['RUBY_DEBUG_NO_RELINE'] = 'true' ENV['RUBY_DEBUG_HISTORY_FILE'] = '' - ENV['TERM'] = 'dumb' write_temp_file(strip_line_num(program)) @scenario = []