From: liran.last@... Date: 2020-11-01T11:54:12+00:00 Subject: [ruby-core:100685] [Ruby master Bug#17302] The TracePoint API does not allow setting multiple line traces within the same method (ISEQ) Issue #17302 has been updated by liran.last@gmail.com (Liran Haimovitch). File my_test.rb added liran.last@gmail.com (Liran Haimovitch) wrote: > When setting a second line tracepoint within a method the first one will be turned off. > > I believe this is due to the fact that the encoded_iseq_trace_instrument function resets the trace value of an instruction rather then just turn 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 Attaching a short file to reproduce the bug, based on the existing `enable_spec.rb` in the Ruby repo. ---------------------------------------- Bug #17302: The TracePoint API does not allow setting multiple line traces within the same method (ISEQ) https://bugs.ruby-lang.org/issues/17302#change-88326 * Author: liran.last@gmail.com (Liran Haimovitch) * Status: Open * Priority: Normal * Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN ---------------------------------------- When setting a second line tracepoint within a method the first one will be turned off. I believe this is due to the fact that the encoded_iseq_trace_instrument function resets the trace value of an instruction rather then just turn 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) -- https://bugs.ruby-lang.org/ Unsubscribe: