Module Debugger
In: lib/ruby-debug-base.rb
ext/ruby_debug.c

Summary

This is a singleton class allows controlling the debugger. Use it to start/stop debugger, set/remove breakpoints, etc.

Methods

Classes and Modules

Class Debugger::Breakpoint
Class Debugger::Context

Constants

VERSION = rb_str_new2(DEBUG_VERSION)

Attributes

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

Public Class methods

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 an array of all contexts.

Returns current context. Note: Debugger.current_context.thread == Thread.current

Register at_exit hook which is escaped from the debugger. FOR INTERNAL USE ONLY.

Same as Kernel#load but resets current context‘s frames. stop parameter force the debugger to stop at the first line of code in the file FOR INTERNAL USE ONLY.

Interrupts the current thread

Interrupts the last debugged thread

Setting to true will make the debugger create frame bindings.

Returns true if the debugger will collect frame bindings.

Returns last debugged context.

Activates the post-mortem mode. There are two ways of using it:

Global post-mortem mode

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.

Local 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

Sets post-moterm flag. FOR INTERNAL USE ONLY.

Returns true if post-moterm debugging is enabled.

Removes breakpoint by its id. id is an identificator of a breakpoint.

The code inside of the block is escaped from the debugger.

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.

Returns true the debugger is started.

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.

Returns context of the thread passed as an argument.

Returns true if the global tracing is activated.

Sets the global tracing flag.

Setting to true will make the debugger save argument info on calls.

Returns true if the debugger track frame argument values on calls.

[Validate]