Issue #13392 has been updated by alanwu (Alan Wu).


I implemented an alternative fix that is more complicated but allows for fu=
ture optimizations here: https://github.com/ruby/ruby/pull/4637
Some relevant details about it are in Jeremy's GitHub PR.

----------------------------------------
Bug #13392: TracePoint return event location is incorrect for methods defin=
ed with define_method
https://bugs.ruby-lang.org/issues/13392#change-93104

* Author: areman01 (Andr=E9 Kullmann)
* Status: Open
* Priority: Normal
* ruby -v: ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------


**Command**

~~~ ruby
ruby tracepoint_bug.rb
~~~

**Output**

~~~
ruby-2.4.1-p111 (x86_64-linux)
tracepoint_bug_ext.rb:4 call to_s
tracepoint_bug_ext.rb:5 c_call to_s
tracepoint_bug_ext.rb:5 c_return to_s
racepoint_bug.rb:12 return to_s
~~~

Why the **call event** on *to_s* is in file *tracepoint_bug_ext.rb* and the=
 **return event** in file *tracepoint_bug.rb*? I think it's a bug. In jruby=
, for example, the call and the return event are both fired in the tracepoi=
nt_bug_ext.rb file.   =



---Files--------------------------------
tracepoint_bug.rb (495 Bytes)
tracepoint_bug_ext.rb (126 Bytes)


-- =

https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=3Dunsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>