diver_down 0.0.1.alpha9 → 0.0.1.alpha10

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: b7a272e39e974d543ceec5219e3b5505bca70d0a61afae0632107eb3cc5645fe
4
- data.tar.gz: c6df48a9145a3d87c6b8816b6a37830bdbab3c6404d0d0347cb43bf3be636ec1
3
+ metadata.gz: 45734000dad7ab44ca75037957b39dc6caae34d1189864f563ec251453972db8
4
+ data.tar.gz: bf21e0f1faeaa051f6fc4e001ff0544570994fc98d8cc75da92c8fd5f6e5d294
5
5
  SHA512:
6
- metadata.gz: 5a1d631fe52cab90a2c005f96480751007056414accfb50d3aaa59f337614c69cd5082ed77b456f68b4fce5f4ff17404296df2e84f82159b4abdcdf354d2b996
7
- data.tar.gz: 3144ca2c364a66e8d20db470887f6d7499d05ffdb39a379b85d4aac093808971963baa76340863dc93f2e2480af4d2dba035a2874c2926f23bd015cff5b39f59
6
+ metadata.gz: 3060ddaba43ef6d91c01e9eb5b9ede908a61629e563d2dfef6b2775a59843cd3cd4e34c0505320ffc035e04459dc00744cf0dc58f8302de812a7b15d2b6b357c
7
+ data.tar.gz: bb258e2b3e308848e9debee4acd34930dbe375bc07ec639daeac97d24ff514f4e03a8f3b2cee8717ffb29d10b3600a97a645a9104b3481b4153c2f8ab0ce7ad9
@@ -46,6 +46,10 @@ module DiverDown
46
46
  next if TracePoint == tp.defined_class
47
47
 
48
48
  case tp.event
49
+ when :b_call
50
+ call_stack.push
51
+ when :b_return
52
+ call_stack.pop
49
53
  when :call, :c_call
50
54
  # puts "#{tp.method_id} #{tp.path}:#{tp.lineno}"
51
55
  if call_stack.ignored?
@@ -3,9 +3,18 @@
3
3
  module DiverDown
4
4
  module Trace
5
5
  class Tracer
6
+ DEFAULT_TRACE_EVENTS = %i[
7
+ call
8
+ return
9
+ c_call
10
+ c_return
11
+ b_call
12
+ b_return
13
+ ].freeze
14
+
6
15
  # @return [Array<Symbol>]
7
16
  def self.trace_events
8
- @trace_events || %i[call c_call return c_return]
17
+ @trace_events || DEFAULT_TRACE_EVENTS
9
18
  end
10
19
 
11
20
  # @param events [Array<Symbol>]
@@ -11,16 +11,12 @@ module DiverDown
11
11
  require 'diver_down/trace/redefine_ruby_methods'
12
12
  require 'diver_down/trace/ignored_method_ids'
13
13
 
14
- @trace_events = %i[
15
- call c_call return c_return
16
- ]
17
-
18
14
  # Trace only Ruby-implemented methods because tracing C-implemented methods is very slow
19
15
  # Override Ruby only with the minimal set of methods needed to trace dependencies.
20
16
  #
21
17
  # @return [void]
22
18
  def self.trace_only_ruby_world!(map = DiverDown::Trace::RedefineRubyMethods::DEFAULT_METHODS)
23
- DiverDown::Trace::Tracer.trace_events = %i[call return]
19
+ DiverDown::Trace::Tracer.trace_events = DiverDown::Trace::Tracer::DEFAULT_TRACE_EVENTS - %i[c_call c_return]
24
20
  DiverDown::Trace::RedefineRubyMethods.redefine_c_methods(map)
25
21
  end
26
22
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DiverDown
4
- VERSION = '0.0.1.alpha9'
4
+ VERSION = '0.0.1.alpha10'
5
5
  end