Class Debugger::Command
In: cli/ruby-debug/command.rb
Parent: Object

A Debugger::Command object is is the base class for commands that implement a single debugger command. Individual debugger commands will be a subclass of this. The singleton class object is the command manager for all commands.

Each debugger command is expected to implement the following methods:

regexp:A regular expression which input strings are matched against. If we have a match, run this command. It is the ruby-debug programmer‘s responsibility to make sure that these regular expressions match disjoint sets of strings. Otherwise one is arbitrarily used.
execute:Ruby code that implements the command.
help:Should return a String containing descriptive help for the commmand. Used by the ‘help’ command Debugger::HelpCommand
help_command:The name of the command listed via help.

help and help_command methods are singleton methods, not instance methods like regexp and execute.

Methods

Included Modules

Columnize

Constants

SubcmdStruct = Struct.new(:name, :min, :short_help, :long_help) unless defined?(SubcmdStruct)
DEF_OPTIONS = { :allow_in_control => false, :allow_in_post_mortem => true, :event => true, :always_run => 0, :unknown => false, :need_context => false, } unless defined?(DEF_OPTIONS)
ARGV = ARGV.clone

Public Class methods

An Array containing Debugger::Command classes that implment each of the debugger commands.

Read in and "include" all the subclasses of the Debugger::Command class. For example Debugger::QuitCommand is one of them. The list of Ruby files to read are all the files that end .rb in directory Debugger::RUBY_DEBUG_DIR

Returns a Hash of Debugger settings, @settings. If doesn‘t exist we create a @settings hash with [] setter and getter and return that.

Public Instance methods

Find param in subcmds. The param id downcased and can be abbreviated to the minimum length listed in the subcommands

Protected Instance methods

Called when we are about to do a dangerous operation. msg contains a prompt message. Return true if confirmed or false if not confirmed.

debug_eval like Kernel.eval or Object.instance_eval but using the bindings for the debugged program. If there is a syntax-error like exception in running eval, print an appropriate message and throw :debug_error

debug_eval like Kernel.eval or Object.instance_eval but using the bindings for the debugged program. If there is a syntax error kind of exception in running eval, no warning is given and nil is returned.

FIXME: use delegate?

Return a binding object for the debugged program.

[Validate]