Class: Debugger::DeleteDisplayCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/display.rb

Overview

:nodoc:

Constant Summary

Constants inherited from Command

Command::DEF_OPTIONS

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Command

commands, #find, inherited, #initialize, load_commands, #match, method_missing, options, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



108
109
110
111
112
113
114
115
116
117
# File 'lib/ruby-debug/commands/display.rb', line 108

def help(cmd)
  %{
    undisp[lay][ nnn]
    Cancel some expressions to be displayed when program stops.
    Arguments are the code numbers of the expressions to stop displaying.
    No argument means cancel all automatic-display expressions.
    "delete display" has the same effect as this command.
    Do "info display" to see current list of code numbers.
  }
end

.help_commandObject



104
105
106
# File 'lib/ruby-debug/commands/display.rb', line 104

def help_command
  'undisplay'
end

Instance Method Details

#executeObject



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ruby-debug/commands/display.rb', line 85

def execute
  unless pos = @match[1]
    if confirm("Clear all expressions? (y/n) ")
      for d in @state.display
        d[0] = false
      end
    end
  else
    pos = get_int(pos, "Undisplay")
    return unless pos
    if @state.display[pos-1]
      @state.display[pos-1][0] = nil
    else
      errmsg "Display expression %d is not defined.\n", pos
    end
  end
end

#regexpObject



81
82
83
# File 'lib/ruby-debug/commands/display.rb', line 81

def regexp
  /^\s* undisp(?:lay)? \s* (?:(\S+))?$/x
end