Class: Byebug::ThreadSwitchCommand
- Inherits:
-
Command
- Object
- Command
- Byebug::ThreadSwitchCommand
show all
- Defined in:
- lib/byebug/commands/threads.rb
Overview
Switch execution to a different thread.
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Command
commands, find, format_subcmd, format_subcmds, help, inherited, #initialize, load_commands, #match
Class Method Details
.description ⇒ Object
208
209
210
|
# File 'lib/byebug/commands/threads.rb', line 208
def description
%(th[read] [sw[itch]] <nnn> Switches thread context to <n>.)
end
|
.names ⇒ Object
204
205
206
|
# File 'lib/byebug/commands/threads.rb', line 204
def names
%w(thread)
end
|
Instance Method Details
#execute ⇒ Object
189
190
191
192
193
194
195
196
197
198
199
200
201
|
# File 'lib/byebug/commands/threads.rb', line 189
def execute
if @match[1] =~ /switch/
return errmsg('"thread switch" needs a thread number')
end
c = parse_thread_num_for_cmd('thread switch', @match[1])
return unless c
display_context(c)
c.step_into 1
c.thread.run
@state.proceed
end
|
#regexp ⇒ Object
185
186
187
|
# File 'lib/byebug/commands/threads.rb', line 185
def regexp
/^\s* th(?:read)? \s+ (?:sw(?:itch)?\s+)? (\S+) \s*$/x
end
|