Class: RunLoop::LLDB
- Inherits:
-
Object
- Object
- RunLoop::LLDB
- Defined in:
- lib/run_loop/lldb.rb
Overview
A class for interacting with the lldb command-line tool
Class Method Summary collapse
-
.kill_lldb_processes ⇒ Object
Attempts to gracefully kill all running lldb processes.
-
.lldb_pids ⇒ Array<Integer>
Returns a list of lldb pids.
Class Method Details
.kill_lldb_processes ⇒ Object
Attempts to gracefully kill all running lldb processes.
34 35 36 37 38 |
# File 'lib/run_loop/lldb.rb', line 34 def self.kill_lldb_processes self.lldb_pids.each do |pid| self.kill_with_signal(pid, 'KILL') end end |
.lldb_pids ⇒ Array<Integer>
Returns a list of lldb pids.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/run_loop/lldb.rb', line 8 def self.lldb_pids ps_output = `#{LLDB_FIND_PIDS_CMD}`.strip lines = ps_output.lines("\n").map { |line| line.strip } lldb_processes = lines.select { |line| self.is_lldb_process?(line) } lldb_processes.map do |ps_description| tokens = ps_description.strip.split(' ').map { |token| token.strip } pid = tokens.fetch(0, nil) if pid.nil? nil else pid.to_i end end.compact.sort end |