Class: Debugger::PauseCommand

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

Overview

Implements debugger “pause” command

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

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



25
26
27
28
29
# File 'lib/ruby-debug/commands/pause.rb', line 25

def help(cmd)
   %{
     pause <nnn>\tpause a running thread
    }
end

.help_commandObject



21
22
23
# File 'lib/ruby-debug/commands/pause.rb', line 21

def help_command
  %w[pause]
end

Instance Method Details

#executeObject



11
12
13
14
15
16
17
18
# File 'lib/ruby-debug/commands/pause.rb', line 11

def execute
  c = get_context(@match[1].to_i)
  unless c.respond_to?(:pause)
    print_msg "Not implemented"
    return
  end
  c.pause
end

#regexpObject



7
8
9
# File 'lib/ruby-debug/commands/pause.rb', line 7

def regexp
  /^\s*pause\s*(?:\s+(\S+))?\s*$/
end