Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions exe/rdbg
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,12 @@ when :start
start_mode = config[:open] ? "open" : 'start'
cmd = config[:command] ? ARGV.shift : (ENV['RUBY'] || RbConfig.ruby)

if defined?($:.resolve_feature_path)
begin
_, sopath = $:.resolve_feature_path('debug/debug.so')
rescue LoadError
# raises LoadError before 3.1 (2.7 and 3.0)
else
sopath = File.dirname(File.dirname(sopath)) if sopath
end
begin
_, sopath = $:.resolve_feature_path('debug/debug.so')
rescue LoadError
# raises LoadError before 3.1 (2.7 and 3.0)
else
# `$:.resolve_feature_path` is not defined in 2.6 or earlier.
so = "debug/debug.#{RbConfig::CONFIG['DLEXT']}"
sopath = $:.find {|dir| File.exist?(File.join(dir, so))}
sopath = File.dirname(File.dirname(sopath)) if sopath
end
added = "-r #{libpath}/#{start_mode}"
added = "-I #{sopath} #{added}" if sopath
Expand Down
25 changes: 7 additions & 18 deletions lib/debug/breakpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -476,24 +476,13 @@ def enable
try_enable
end

if RUBY_VERSION.to_f <= 2.6
def override klass
sig_method_name = @sig_method_name
klass.prepend Module.new{
define_method(sig_method_name) do |*args, &block|
super(*args, &block)
end
}
end
else
def override klass
sig_method_name = @sig_method_name
klass.prepend Module.new{
define_method(sig_method_name) do |*args, **kw, &block|
super(*args, **kw, &block)
end
}
end
def override klass
sig_method_name = @sig_method_name
klass.prepend Module.new{
define_method(sig_method_name) do |*args, **kw, &block|
super(*args, **kw, &block)
end
}
end

def try_enable added: false
Expand Down
9 changes: 0 additions & 9 deletions lib/debug/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2664,12 +2664,3 @@ class Binding
alias break debugger
alias b debugger
end

# for Ruby 2.6 compatibility
unless method(:p).unbind.respond_to? :bind_call
class UnboundMethod
def bind_call(obj, *args)
self.bind(obj).call(*args)
end
end
end
Loading