tracetool 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afbd4e779196959227fce1f14d17eb630f614ac8d8381917ce6856d20afe8965
4
- data.tar.gz: 83631e87b47888b320a67e4a7b565426f6ed9f00ce577eef769ee4b7809baa29
3
+ metadata.gz: 7b0baff5d5f633d2474acf70b639fad429dd09b5b4cc4f80333ef55f72c1e5d8
4
+ data.tar.gz: 2851ab0c1b575429400937ad889b0a06fdce6f9ebaf550b05956b7879166d6f6
5
5
  SHA512:
6
- metadata.gz: b32f99eff59b5365612ddb8ffe245d915a6b38867b7a933199b227ad6fb456f2a9fa00d25b4c13fb935dc5e167fdac63a4ecb395be9ac44af0740e7bae4026c5
7
- data.tar.gz: 4a1e752a9e5f9a0eb3ad3b00c2dc62fe7af0640e1de9ec7a9de817180fb0c976159f3da3ee8d962e99b648a1a55294e925114320871037bfd9d23ed4afd97d43
6
+ metadata.gz: ba21b749c8875fec7e26c70da2899dfb89ea5c0fcfed2a7fc1233b34ee222d5de43cf630fc13998cf3e95335eee152e75e7fdfea8e998867ccfbd3c581eb3a1b
7
+ data.tar.gz: 7f0236c1c234fa42c8fc68874cbc63e0271c773078c64cf50a5bea4e1d6951757affb02064360590c5668e559633e85b6a237d6dff7d901edfe23fbf7a522888
@@ -1,3 +1,4 @@
1
+ require_relative 'ios/atos_context'
1
2
  require_relative 'ios/scanner'
2
3
  require_relative 'ios/parser'
3
4
 
@@ -0,0 +1,35 @@
1
+ module Tracetool
2
+ module IOS
3
+ # Converts context to atos arguments
4
+ class AtosContext
5
+ # If no arch specified will use `arm64`
6
+ DEFAULT_ARCH = 'arm64'.freeze
7
+
8
+ # List of required argument names
9
+ REQUIRED_ARGUMENTS = %i[load_address xarchive module_name].freeze
10
+
11
+ def initialize(ctx)
12
+ check_arguments(ctx)
13
+ @load_address = ctx.load_address
14
+ @binary_path = module_binary(ctx.xarchive, ctx.module_name)
15
+ @arch = ctx.arch || 'arm64'
16
+ end
17
+
18
+ def to_args
19
+ %w[-o -l -arch].zip([@binary_path, @load_address, @arch]).flatten
20
+ end
21
+
22
+ private
23
+
24
+ def module_binary(xarchive, module_name)
25
+ File.join(xarchive, 'dSYMs', "#{module_name}.app.dSYM", 'Contents', 'Resources', 'DWARF', module_name)
26
+ end
27
+
28
+ def check_arguments(ctx)
29
+ REQUIRED_ARGUMENTS.each do |a|
30
+ ctx[a] || raise(ArgumentError, "Missing `#{a}` value")
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -1,37 +1,5 @@
1
1
  module Tracetool
2
2
  module IOS
3
- # Converts context to atos arguments
4
- class AtosContext
5
- # If no arch specified will use `arm64`
6
- DEFAULT_ARCH = 'arm64'.freeze
7
-
8
- # List of required argument names
9
- REQUIRED_ARGUMENTS = %i[load_address xarchive module_name].freeze
10
-
11
- def initialize(ctx)
12
- check_arguments(ctx)
13
- @load_address = ctx.load_address
14
- @binary_path = module_binary(ctx.xarchive, ctx.module_name)
15
- @arch = ctx.arch || 'arm64'
16
- end
17
-
18
- def to_args
19
- %w[-o -l -arch].zip([@binary_path, @load_address, @arch]).flatten
20
- end
21
-
22
- private
23
-
24
- def module_binary(xarchive, module_name)
25
- File.join(xarchive, 'dSYMs', "#{module_name}.app.dSYM", 'Contents', 'Resources', 'DWARF', module_name)
26
- end
27
-
28
- def check_arguments(ctx)
29
- REQUIRED_ARGUMENTS.each do |a|
30
- ctx[a] || raise(ArgumentError, "Missing `#{a}` value")
31
- end
32
- end
33
- end
34
-
35
3
  # launches atos
36
4
  class IOSTraceScanner
37
5
  # Stack trace line consists of numerous whitespace separated
@@ -44,8 +12,27 @@ module Tracetool
44
12
  # @return [Array] containing (%binary_name%, %address%) pairs
45
13
  def parse(trace)
46
14
  trace.split("\n").map do |line|
47
- line.split(' ')[1..2] # Fetch binary name and address
15
+ parse_line(line)
16
+ end
17
+ end
18
+
19
+ # Parse trace line from trace. Which usualy looks like this:
20
+ # 3 My Module Name 0x0000000102d6e9f4 My Module Name + 5859828
21
+ # We need to fetch two values: 'My Module Name' and '0x0000000102d6e9f4'.
22
+ def parse_line(line)
23
+ parts = line.split(' ')
24
+ parts.shift # Frame number, not needed
25
+
26
+ module_name = ''
27
+
28
+ until parts.first.start_with?('0x')
29
+ module_name += parts.shift
30
+ module_name += ' '
48
31
  end
32
+
33
+ address = parts.shift
34
+
35
+ [module_name.chop, address]
49
36
  end
50
37
 
51
38
  def process(trace, context)
@@ -1,7 +1,7 @@
1
1
  module Tracetool
2
2
  # Version constant
3
3
  module Version
4
- VERSION = [0, 5, 1].freeze
4
+ VERSION = [0, 5, 2].freeze
5
5
 
6
6
  class << self
7
7
  # @return [String] version string
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracetool
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - ilya.arkhanhelsky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-21 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: powerpack
@@ -37,6 +37,7 @@ files:
37
37
  - lib/tracetool/android/java.rb
38
38
  - lib/tracetool/android/native.rb
39
39
  - lib/tracetool/ios.rb
40
+ - lib/tracetool/ios/atos_context.rb
40
41
  - lib/tracetool/ios/parser.rb
41
42
  - lib/tracetool/ios/scanner.rb
42
43
  - lib/tracetool/utils/cli.rb
@@ -65,7 +66,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
66
  - !ruby/object:Gem::Version
66
67
  version: '0'
67
68
  requirements: []
68
- rubygems_version: 3.0.3
69
+ rubygems_version: 3.1.2
69
70
  signing_key:
70
71
  specification_version: 4
71
72
  summary: Tracetool