Class: Debugger::ThreadResumeCommand

Inherits:
Command
  • Object
show all
Includes:
ThreadFunctions
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 included from ThreadFunctions

#debugger_thread?, #display_context

Methods inherited from Command

commands, inherited, #initialize, load_commands, #match, method_missing, options

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



178
179
180
181
182
# File 'lib/ruby-debug/commands/threads.rb', line 178

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

.help_commandObject



174
175
176
# File 'lib/ruby-debug/commands/threads.rb', line 174

def help_command
  'thread'
end

Instance Method Details

#executeObject



158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/ruby-debug/commands/threads.rb', line 158

def execute
  c = get_context(@match[1].to_i)
  case
  when c == @state.context
    print "It's the current thread.\n"
  when debugger_thread?(c)
    print "Can't resume the debugger thread.\n"
  when !c.thread.stop?
    print "Already running."
  else
    c.resume
    display_context(c)
  end
end

#regexpObject



154
155
156
# File 'lib/ruby-debug/commands/threads.rb', line 154

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