Skip to content

Commit

Permalink
Merge pull request #1157 from ruby/ak/import-recent-changes-in-ruby
Browse files Browse the repository at this point in the history
Import manually changes in ruby/ruby#10947
  • Loading branch information
andrykonchin committed Jun 10, 2024
2 parents a76a91c + 979accc commit 0670d08
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions core/tracepoint/inspect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
line = nil
TracePoint.new(:line) { |tp|
next unless TracePointSpec.target_thread?
next unless tp.path == __FILE__

inspect ||= tp.inspect
}.enable do
line = __LINE__
Expand All @@ -37,6 +39,8 @@
line = nil
TracePoint.new(:call) { |tp|
next unless TracePointSpec.target_thread?
next unless tp.path == __FILE__

inspect ||= tp.inspect
}.enable do
line = __LINE__ + 1
Expand All @@ -52,6 +56,8 @@ def trace_point_spec_test_call; end
line = nil
TracePoint.new(:return) { |tp|
next unless TracePointSpec.target_thread?
next unless tp.path == __FILE__

inspect ||= tp.inspect
}.enable do
line = __LINE__ + 4
Expand All @@ -69,6 +75,8 @@ def trace_point_spec_test_return
inspect = nil
tracepoint = TracePoint.new(:c_call) { |tp|
next unless TracePointSpec.target_thread?
next unless tp.path == __FILE__

inspect ||= tp.inspect
}
line = __LINE__ + 2
Expand All @@ -84,6 +92,8 @@ def trace_point_spec_test_return
line = nil
TracePoint.new(:class) { |tp|
next unless TracePointSpec.target_thread?
next unless tp.path == __FILE__

inspect ||= tp.inspect
}.enable do
line = __LINE__ + 1
Expand All @@ -100,6 +110,7 @@ class TracePointSpec::C
thread_inspection = nil
TracePoint.new(:thread_begin) { |tp|
next unless Thread.current == thread

inspect ||= tp.inspect
}.enable(target_thread: nil) do
thread = Thread.new {}
Expand All @@ -116,6 +127,7 @@ class TracePointSpec::C
thread_inspection = nil
TracePoint.new(:thread_end) { |tp|
next unless Thread.current == thread

inspect ||= tp.inspect
}.enable(target_thread: nil) do
thread = Thread.new {}
Expand Down

0 comments on commit 0670d08

Please sign in to comment.