Sometimes, when using parenthesis, I get duplicated lines events from the TracePoint API. See the failing test case, it generates 2 line events where I think it should generate just one.
Hi Koichi, I've looked at the patch and it seems to me that every duplicated event has been removed. So if I do something like
object.method1.method2.method3
only one line event will be generated. Is this the case?
If that's the case I actually preferred the previous behaviour so it is possible to inspect intermediate results. byebug is aware of this duplication and even provides an option that ignores duplicated events in case the user wants to always change line when stepping through the code.
I just reported this specific case cause I couldn't recognize the "separate line events" but in general I think the behaviour was fine.
Actually I've given this a second thought and I'm fine with the change. The funcionality loss is minimal (and easy to do it in other ways), the patch corrects issues like this one and the code using the API will be simpler as it will not need to handle the duplication.
Oops, I need to start thinking before talking... :) The change in the behaviour actually happened in this example so something like the following used to generate 2 line events before the change.
TracePoint.new(:line){|tp|
p [tp.event, tp.lineno]
}.enable{
num = 1 ; num += 1
}
Using semicolon is the only case I found when this happened (other that this issue), and it's not a very popular style anyways.
So definitely up for keeping this fix. Could we get this backported to 2.0 and 2.1?