module Byebug::EvalFunctions

def run_with_binding

def run_with_binding
  binding = get_binding
  $__dbg_interface = @state.interface
  eval(<<-EOC, binding)
    __dbg_verbose_save=$VERBOSE; $VERBOSE=false
    def dbg_print(*args)
      $__dbg_interface.print(*args)
    end
    remove_method :puts if self.respond_to?(:puts) &&
      defined?(remove_method)
    def dbg_puts(*args)
      $__dbg_interface.print(*args)
      $__dbg_interface.print("\n")
    end
    $VERBOSE=__dbg_verbose_save
  EOC
  yield binding
ensure
  $__dbg_interface = nil
end