Module: Kernel

Defined in:
lib/byebug.rb

Instance Method Summary collapse

Instance Method Details

#binding_n(n = 0) ⇒ Object

Returns a binding of n-th call frame



391
392
393
394
395
# File 'lib/byebug.rb', line 391

def binding_n(n = 0)
  Byebug.skip do
    Byebug.current_context.frame_binding(n+1)
  end
end

#byebug(steps = 1) ⇒ Object Also known as: breakpoint

Enters byebug in the current thread after steps line events occur.

Before entering byebug startup, the init script is read. Setting steps to 0 will cause a break in byebug’s subroutine and not wait for a line event to occur. You will have to go “up 1” in order to be back to your debugged program from byebug. Setting steps to 0 could be useful if you want to stop right after the last statement in some scope, because the next step will take you out of some scope.



377
378
379
380
381
382
383
384
385
# File 'lib/byebug.rb', line 377

def byebug(steps = 1)
  Byebug.start
  Byebug.run_init_script(StringIO.new)
  if 0 == steps
    Byebug.current_context.stop_frame = 0
  else
    Byebug.current_context.stop_next = steps
  end
end