lib/byebug/breakpoint.rb in byebug-4.0.5 vs lib/byebug/breakpoint.rb in byebug-5.0.0
- old
+ new
@@ -46,10 +46,11 @@
# line number appear more than once.
#
# @param filename [String] File name to inspect for possible breakpoints
#
def self.potential_lines(filename)
- name, lines = "#{Time.new.to_i}_#{rand(2**31)}", {}
+ name = "#{Time.new.to_i}_#{rand(2**31)}"
+ lines = {}
iseq = RubyVM::InstructionSequence.compile(File.read(filename), name)
iseq.disasm.each_line do |line|
res = /^\d+ (?<insn>\w+)\s+.+\(\s*(?<lineno>\d+)\)$/.match(line)
next unless res && res[:insn] == 'trace'