lib/byebug/processors/command_processor.rb in byebug-3.1.2 vs lib/byebug/processors/command_processor.rb in byebug-3.2.0
- old
+ new
@@ -1,7 +1,6 @@
module Byebug
-
class CommandProcessor < Processor
attr_reader :display
def initialize(interface = LocalInterface.new)
super(interface)
@@ -59,28 +58,30 @@
END
end
def at_breakpoint(context, breakpoint)
n = Byebug.breakpoints.index(breakpoint) + 1
- file = CommandProcessor.canonic_file(breakpoint.source)
+ file = self.class.canonic_file(breakpoint.source)
line = breakpoint.pos
print "Stopped by breakpoint #{n} at #{file}:#{line}\n"
end
protect :at_breakpoint
def at_catchpoint(context, excpt)
- file = CommandProcessor.canonic_file(context.frame_file(0))
+ file = self.class.canonic_file(context.frame_file(0))
line = context.frame_line(0)
print "Catchpoint at %s:%d: `%s' (%s)\n", file, line, excpt, excpt.class
end
protect :at_catchpoint
+ include ParseFunctions
+
def at_tracing(context, file, line)
if file != @last_file || line != @last_line || Setting[:tracing_plus]
+ path = self.class.canonic_file(file)
@last_file, @last_line = file, line
- print "Tracing: #{CommandProcessor.canonic_file(file)}:#{line} " \
- "#{Byebug.line_at(file,line)}\n"
+ print "Tracing: #{path}:#{line} #{get_line(file, line)}"
end
always_run(context, file, line, 2)
end
protect :at_tracing
@@ -234,15 +235,14 @@
def proceed
@proceed = true
end
def location
- loc = "#{CommandProcessor.canonic_file(@file)} @ #{@line}\n"
- loc += "#{Byebug.line_at(@file, @line)}\n" unless
+ path = self.class.canonic_file(@file)
+ loc = "#{path} @ #{@line}\n"
+ loc += "#{get_line(@file, @line)}\n" unless
['(irb)', '-e'].include? @file
loc
end
end
-
end # class CommandProcessor
-
end