Class: Tracetool::IOS::IOSTraceScanner

Inherits:
Object
  • Object
show all
Defined in:
lib/tracetool/ios/scanner.rb

Overview

launches atos

Instance Method Summary collapse

Instance Method Details

#parse(trace) ⇒ Array

Stack trace line consists of numerous whitespace separated columns. First three always are:

  • frame #

  • binary name

  • address

Parameters:

  • trace (String)

    string containing stack trace

Returns:

  • (Array)

    containing (%binary_name%, %address%) pairs



45
46
47
48
49
# File 'lib/tracetool/ios/scanner.rb', line 45

def parse(trace)
  trace.split("\n").map do |line|
    line.split(' ')[1..2] # Fetch binary name and address
  end
end

#parser(files) ⇒ Tracetool::BaseTraceParser

Create parser for current trace format

Parameters:

  • files (Array)

    list of files used in build. This files are used to match file entries from stack trace to real files

Returns:



66
67
68
# File 'lib/tracetool/ios/scanner.rb', line 66

def parser(files)
  IOSTraceParser.new(files)
end

#process(trace, context) ⇒ Object



51
52
53
54
55
56
# File 'lib/tracetool/ios/scanner.rb', line 51

def process(trace, context)
  trace = parse(trace)
  desym = run_atos(context, trace.map(&:last))
  # Add useful columns to unpacked trace
  mix(trace, desym.split("\n")).join("\n")
end

#run_atos(context, trace) ⇒ Object



58
59
60
# File 'lib/tracetool/ios/scanner.rb', line 58

def run_atos(context, trace)
  Pipe['atos', *AtosContext.new(context).to_args] << trace
end