Class: Tracetool::BaseTraceParser
- Inherits:
-
Object
- Object
- Tracetool::BaseTraceParser
- Defined in:
- lib/tracetool/utils/parser.rb
Overview
Base trace parser logic
Direct Known Subclasses
Android::JavaTraceParser, Android::NativeTraceParser, IOS::IOSTraceParser
Instance Attribute Summary collapse
-
#call_pattern ⇒ Object
readonly
Returns the value of attribute call_pattern.
-
#entry_pattern ⇒ Object
readonly
Returns the value of attribute entry_pattern.
Instance Method Summary collapse
-
#initialize(entry_pattern, call_pattern, build_files, convert_numbers = false) ⇒ BaseTraceParser
constructor
A new instance of BaseTraceParser.
-
#parse(lines) ⇒ Object
Parse crash dump Each line should be parsed in Hash which SHOULD or MAY contains following entries:.
Constructor Details
#initialize(entry_pattern, call_pattern, build_files, convert_numbers = false) ⇒ BaseTraceParser
Returns a new instance of BaseTraceParser.
6 7 8 9 10 11 |
# File 'lib/tracetool/utils/parser.rb', line 6 def initialize(entry_pattern, call_pattern, build_files, convert_numbers = false) @build_files = build_files @entry_pattern = entry_pattern @call_pattern = call_pattern @convert_numbers = convert_numbers end |
Instance Attribute Details
#call_pattern ⇒ Object (readonly)
Returns the value of attribute call_pattern.
4 5 6 |
# File 'lib/tracetool/utils/parser.rb', line 4 def call_pattern @call_pattern end |
#entry_pattern ⇒ Object (readonly)
Returns the value of attribute entry_pattern.
4 5 6 |
# File 'lib/tracetool/utils/parser.rb', line 4 def entry_pattern @entry_pattern end |
Instance Method Details
#parse(lines) ⇒ Object
Parse crash dump Each line should be parsed in Hash which SHOULD or MAY contains following entries:
-
SHOULD contain
origentry – original trace entry -
MAY contain following entries IF original entry matched pattern:
** frame - stack frame index ** lib - shared library name (android) or module name (ios) ** call_description - original call block ** MAY contain call entry if call_description was recognized: *** method - namespaced method name (with class and its namespace) *** file - file path relative to ‘symbols dir` *** line - line number in specified file
26 27 28 29 30 31 |
# File 'lib/tracetool/utils/parser.rb', line 26 def parse(lines) lines .split("\n") .select { |line| line_filter(line) } .map { |line| scan_call(scan_line(line)) } end |