kernel/common/kernel.rb
##
# Activates the singleton Debugger instance, and sets a breakpoint
# immediately after the call site to this method.
#--
# TODO: Have method take an options hash to configure debugger behavior,
# and perhaps a block containing debugger commands to be executed when the
# breakpoint is hit.
Activates the singleton Debugger instance, and sets a breakpoint
immediately after the call site to this method.

Have method take an options hash to configure debugger behavior,
and perhaps a block containing debugger commands to be executed when the
breakpoint is hit.
Activates the singleton Debugger instance and sets a breakpoint immediately after the call site to this method . Have method take an options hash to configure debugger behavior and perhaps a block containing debugger commands to be executed when the breakpoint is hit .
def debugger
    require 'debugger/debugger'
    dbg = Debugger.instance
    unless dbg.interface
      require 'debugger/interface'
      Debugger::CmdLineInterface.new
    end
    ctxt = MethodContext.current.sender
    cm = ctxt.method
    ip = ctxt.ip
    bp = dbg.get_breakpoint(cm, ip)
    if bp
      bp.enable unless bp.enabled?
    else
      bp = dbg.set_breakpoint(cm, ip)
    end
  end
def debugger require 'debugger/debugger' dbg = Debugger . instance unless dbg . interface require 'debugger/interface' Debugger :: CmdLineInterface . new end ctxt = MethodContext . current . sender cm = ctxt . method ip = ctxt . ip bp = dbg . get_breakpoint ( cm , ip ) if bp bp . enable unless bp . enabled? else bp = dbg . set_breakpoint ( cm , ip ) end end
Activates the singleton Debugger instance, and sets a breakpoint
immediately after the call site to this method.
Activates the singleton Debugger instance and sets a breakpoint immediately after the call site to this method .
# Default to command-line interface if nothing registered # TODO Modify send site not to call this method again #bc = ctxt.method.iseq #Breakpoint.encoder.replace_instruction(bc, ip-4, [:noop]) #Breakpoint.encoder.replace_instruction(bc, ip-2, [:noop]) #ctxt.reload_method