class Byebug::ControlCommandProcessor

def process_commands(verbose = false)

def process_commands(verbose = false)
  control_cmds = Command.commands.select do |cmd|
    cmd.allow_in_control
  end
  state = State.new(@interface, control_cmds)
  commands = control_cmds.map { |cmd| cmd.new(state) }
  if @context_was_dead
    puts 'The program finished.'
    @context_was_dead = false
  end
  while (input = @interface.read_command(prompt(nil)))
    puts("+#{input}") if verbose
    cmd = commands.find { |c| c.match(input) }
    return errmsg('Unknown command') unless cmd
    cmd.execute
  end
rescue IOError, SystemCallError
rescue
  without_exceptions do
    puts "INTERNAL ERROR!!! #{$ERROR_INFO}"
    puts $ERROR_INFO.backtrace.map { |l| "\t#{l}" }.join("\n")
  end
ensure
  @interface.close
end