Project

General

Profile

Actions

Bug #17302

closed

The TracePoint API does not allow setting multiple line traces within the same method (ISEQ)

Added by liran.last@gmail.com (Liran Haimovitch) over 3 years ago. Updated about 2 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:100684]

Description

While setting a tracepoint for a line for the second time within a method, the first one turns off.

I believe this is because the encoded_iseq_trace_instrument function resets the trace value of an instruction rather than just turning it on if needed: https://github.com/ruby/ruby/blob/799253dc46e96518687dcd4fdca42582251ccffe/iseq.c#L3178

And it is unconditionally called, not limited to the correct line: https://github.com/ruby/ruby/blob/799253dc46e96518687dcd4fdca42582251ccffe/iseq.c#L3219


Files

my_test.rb (790 Bytes) my_test.rb liran.last@gmail.com (Liran Haimovitch), 11/01/2020 11:53 AM

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18646: Inconsistent behavior for the targeted TracePoints in ruby 2.6-2.7 and 3+ClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0