module Byebug::EvalFunctions

def allowing_other_threads


get blocked by byebug's main thread.
creating new threads won't be properly evaluated because new threads will
Used to evaluate stuff within Byebug's prompt. Otherwise, any code

Run block temporarily ignoring all TracePoint events.
def allowing_other_threads
  Byebug.unlock
  res = yield
  Byebug.lock
  res
end

def eval_with_setting(binding, expression, stack_on_error)

Parameters:
  • stack_on_error (Boolean) -- Whether to show a stack trace on error.
  • expression (String) -- Expression to evaluation
  • binding (Binding) -- Context where to evaluate the expression
def eval_with_setting(binding, expression, stack_on_error)
  allowing_other_threads do
    if stack_on_error
      bb_eval(expression, binding)
    else
      bb_warning_eval(expression, binding)
    end
  end
end

def run_with_binding


Get current binding and yield it to the given block
def run_with_binding
  binding = get_binding
  yield binding
end