Class: Debugger::VarLocalCommand
- Defined in:
- lib/ruby-debug/commands/variables.rb
Overview
:nodoc:
Constant Summary
Constants inherited from Command
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Command
commands, #find, inherited, #initialize, load_commands, #match, method_missing, options
Constructor Details
This class inherits a constructor from Debugger::Command
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Debugger::Command
Class Method Details
.help(cmd) ⇒ Object
134 135 136 137 138 |
# File 'lib/ruby-debug/commands/variables.rb', line 134 def help(cmd) %{ v[ar] l[ocal]\t\t\tshow local variables } end |
.help_command ⇒ Object
130 131 132 |
# File 'lib/ruby-debug/commands/variables.rb', line 130 def help_command 'var' end |
Instance Method Details
#execute ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/ruby-debug/commands/variables.rb', line 115 def execute locals = @state.context.frame_locals(@state.frame_pos) _self = @state.context.frame_self(@state.frame_pos) begin locals['self'] = _self unless _self.to_s == "main" rescue => ex locals['self'] = "<Cannot evaluate self>" $stderr << "Cannot evaluate self\n#{ex.class.name}: #{ex.message}\n #{ex.backtrace.join("\n ")}" end print_variables(locals.keys, 'local') do |var| locals[var] end end |
#regexp ⇒ Object
111 112 113 |
# File 'lib/ruby-debug/commands/variables.rb', line 111 def regexp /^\s*v(?:ar)?\s+l(?:ocal)?\s*$/ end |