From: "Eregon (Benoit Daloze)" Date: 2022-03-18T13:03:32+00:00 Subject: [ruby-core:107975] [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 Eregon (Benoit Daloze). Backport was requested in https://bugs.ruby-lang.org/issues/18646, and I adjusted the Backport field for it. ---------------------------------------- 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-96925 * Author: liran.last@gmail.com (Liran Haimovitch) * Status: Closed * Priority: Normal * Backport: 2.6: REQUIRED, 2.7: REQUIRED, 3.0: DONTNEED, 3.1: DONTNEED ---------------------------------------- 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) -- https://bugs.ruby-lang.org/ Unsubscribe: