Module | Debugger |
In: |
lib/ruby-debug-base.rb
ext/ruby_debug.c |
This is a singleton class allows controlling the debugger. Use it to start/stop debugger, set/remove breakpoints, etc.
VERSION | = | rb_str_new2(DEBUG_VERSION) |
handler | [RW] | interface modules provide handler object |
reload_source_on_change | [RW] | if true, checks the modification time of source files and reloads if it was modified |
Adds a new breakpoint. source is a name of a file or a class. pos is a line number or a method name if source is a class name. condition is a string which is evaluated to true when this breakpoint is activated.
Returns a current checkpoint, which is a name of exception that will trigger a debugger when raised.
Returns current context. Note: Debugger.current_context.thread == Thread.current
Activates the post-mortem mode. There are two ways of using it:
By calling Debugger.post_mortem method without a block, you install at_exit hook that intercepts any unhandled by your script exceptions and enables post-mortem mode.
If you know that a particular block of code raises an exception you can enable post-mortem mode by wrapping this block with Debugger.post_mortem, e.g.
def offender raise 'error' end Debugger.post_mortem do ... offender ... end
This method activates the debugger. If it‘s called without a block it returns true, unless debugger was already started. If a block is given, it starts debugger and yields to block. When the block is finished executing it stops the debugger with Debugger.stop method.
Note that if you want to stop debugger, you must call Debugger.stop as many time as you called Debugger.start method.
This method disables the debugger. It returns true if the debugger is disabled, otherwise it returns false.
Note that if you want to stop debugger, you must call Debugger.stop as many times as you called Debugger.start method.