Module: Debugger::ThreadFunctions

Included in:
ThreadCurrentCommand, ThreadListCommand, ThreadResumeCommand, ThreadStopCommand, ThreadSwitchCommand
Defined in:
lib/ruby-debug/commands/threads.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#debugger_thread?(c) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ruby-debug/commands/threads.rb', line 16

def debugger_thread?(c)
  [Debugger.thread, Debugger.control_thread].include?(c.thread)
end

#display_context(c) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ruby-debug/commands/threads.rb', line 3

def display_context(c)
  c_flag = c.thread == Thread.current ? '+' : ' '
  c_flag = '$' if c.suspended?
  d_flag = debugger_thread?(c) ? '!' : ' '
  print "%s%s", c_flag, d_flag
  print "%d ", c.thnum
  print "%s\t", c.thread.inspect
  if c.stack_size > 0
    print "%s:%d", c.frame_file(0), c.frame_line(0)
  end
  print "\n"
end