Class: Debugger::ThreadListCommand

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, register_setting_get, register_setting_set, register_setting_var, settings, settings_map

Constructor Details

This class inherits a constructor from Debugger::Command

Class Method Details

.help(cmd) ⇒ Object



62
63
64
65
66
# File 'lib/ruby-debug/commands/threads.rb', line 62

def help(cmd)
  %{
    th[read] l[ist]\t\t\tlist all threads
  }
end

.help_commandObject



58
59
60
# File 'lib/ruby-debug/commands/threads.rb', line 58

def help_command
  'thread'
end

Instance Method Details

#executeObject



51
52
53
54
55
# File 'lib/ruby-debug/commands/threads.rb', line 51

def execute
  threads = Debugger.contexts.sort_by{|c| c.thnum}.each do |c|
    display_context(c)
  end
end

#regexpObject



47
48
49
# File 'lib/ruby-debug/commands/threads.rb', line 47

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