Class: Byebug::ThreadResumeCommand

Inherits:
Command
  • Object
show all
Includes:
ThreadFunctions
Defined in:
lib/byebug/commands/threads.rb

Overview

Resume execution of a thread.

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ThreadFunctions

#display_context, #parse_thread_num, #parse_thread_num_for_cmd, #thread_arguments

Methods inherited from Command

commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, #match

Methods included from StringFunctions

#camelize, #prettify

Methods included from FileFunctions

#get_line, #get_lines, #n_lines, #normalize

Methods included from ParseFunctions

#get_int, #parse_steps, #syntax_valid?

Constructor Details

This class inherits a constructor from Byebug::Command

Class Method Details

.descriptionObject


194
195
196
197
198
# File 'lib/byebug/commands/threads.rb', line 194

def description
  prettify <<-EOD
    th[read] resume <n>   Resumes thread <n>.
  EOD
end

.namesObject


190
191
192
# File 'lib/byebug/commands/threads.rb', line 190

def names
  %w(thread)
end

Instance Method Details

#executeObject


180
181
182
183
184
185
186
187
# File 'lib/byebug/commands/threads.rb', line 180

def execute
  c, err = parse_thread_num_for_cmd('thread resume', @match[1])
  return errmsg(err) if err
  return errmsg pr('thread.errors.already_running') unless c.suspended?

  c.resume
  display_context(c)
end

#regexpObject


176
177
178
# File 'lib/byebug/commands/threads.rb', line 176

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