class Byebug::IRBCommand

def execute

def execute
  unless @state.interface.kind_of?(LocalInterface)
    print "Command is available only in local mode.\n"
    throw :debug_error
  end
  add_debugging = @match.is_a?(MatchData) && '-d' == @match[1]
  $byebug_state = @state if add_debugging
  cont = IRB.start_session(get_binding)
  case cont
  when :cont
    @state.proceed
  when :step
    force = Command.settings[:force_stepping]
    @state.context.step_into 1, force
    @state.proceed
  when :next
    force = Command.settings[:force_stepping]
    @state.context.step_over 1, @state.frame_pos, force
    @state.proceed
  else
    file = @state.context.frame_file(0)
    line = @state.context.frame_line(0)
    CommandProcessor.print_location_and_text(file, line)
    @state.previous_line = nil
  end
  $byebug_state = nil if add_debugging
end