Class: Debugger::ThreadResumeCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/ruby-debug/commands/threads.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

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



146
147
148
149
150
# File 'lib/ruby-debug/commands/threads.rb', line 146

def help(cmd)
  %{
    th[read] resume <nnn>\t\tresume thread nnn
  }
end

.help_commandObject



142
143
144
# File 'lib/ruby-debug/commands/threads.rb', line 142

def help_command
  'thread'
end

Instance Method Details

#executeObject



128
129
130
131
132
133
134
135
136
137
138
139
# File 'lib/ruby-debug/commands/threads.rb', line 128

def execute
  c = get_context(@match[1].to_i)
  case
  when c == @state.context
    print_msg "It's the current thread."
  when c.ignored?
    print_msg "Can't resume the debugger thread."
  else
    c.resume
    print_context(c)
  end
end

#regexpObject



124
125
126
# File 'lib/ruby-debug/commands/threads.rb', line 124

def regexp
  /^\s*th(?:read)?\s+resume\s+(\d+)\s*$/
end