Class: Byebug::CommandProcessor
- Includes:
- FileFunctions
- Defined in:
- lib/byebug/processors/command_processor.rb
Overview
Processes commands in regular mode
Instance Attribute Summary collapse
-
#display ⇒ Object
readonly
Returns the value of attribute display.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Attributes inherited from Processor
Instance Method Summary collapse
- #at_breakpoint(_context, breakpoint) ⇒ Object
- #at_catchpoint(context, excpt) ⇒ Object
- #at_line(context, file, line) ⇒ Object
- #at_return(context, file, line) ⇒ Object
- #at_tracing(context, file, line) ⇒ Object
-
#initialize(interface = LocalInterface.new) ⇒ CommandProcessor
constructor
A new instance of CommandProcessor.
- #interface=(interface) ⇒ Object
Methods included from FileFunctions
#get_line, #get_lines, #n_lines, #normalize
Methods inherited from Processor
load_commands, load_settings, #without_exceptions
Constructor Details
#initialize(interface = LocalInterface.new) ⇒ CommandProcessor
Returns a new instance of CommandProcessor.
10 11 12 13 14 15 16 |
# File 'lib/byebug/processors/command_processor.rb', line 10 def initialize(interface = LocalInterface.new) super(interface) @display = [] @last_cmd = nil # To allow empty (just <RET>) commands @context_was_dead = false # Assume we haven't started. end |
Instance Attribute Details
#display ⇒ Object (readonly)
Returns the value of attribute display.
8 9 10 |
# File 'lib/byebug/processors/command_processor.rb', line 8 def display @display end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
8 9 10 |
# File 'lib/byebug/processors/command_processor.rb', line 8 def state @state end |
Instance Method Details
#at_breakpoint(_context, breakpoint) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/byebug/processors/command_processor.rb', line 25 def at_breakpoint(_context, breakpoint) n = Byebug.breakpoints.index(breakpoint) + 1 file = normalize(breakpoint.source) line = breakpoint.pos puts "Stopped by breakpoint #{n} at #{file}:#{line}" end |
#at_catchpoint(context, excpt) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/byebug/processors/command_processor.rb', line 33 def at_catchpoint(context, excpt) file = normalize(context.frame_file(0)) line = context.frame_line(0) puts "Catchpoint at #{file}:#{line}: `#{excpt}' (#{excpt.class})" end |
#at_line(context, file, line) ⇒ Object
46 47 48 |
# File 'lib/byebug/processors/command_processor.rb', line 46 def at_line(context, file, line) process_commands(context, file, line) end |
#at_return(context, file, line) ⇒ Object
50 51 52 |
# File 'lib/byebug/processors/command_processor.rb', line 50 def at_return(context, file, line) process_commands(context, file, line) end |
#at_tracing(context, file, line) ⇒ Object
40 41 42 43 44 |
# File 'lib/byebug/processors/command_processor.rb', line 40 def at_tracing(context, file, line) puts "Tracing: #{normalize(file)}:#{line} #{get_line(file, line)}" always_run(context, file, line, 2) end |
#interface=(interface) ⇒ Object
18 19 20 21 |
# File 'lib/byebug/processors/command_processor.rb', line 18 def interface=(interface) @interface.close if @interface @interface = interface end |