Issue #5527 has been updated by Koichi Sasada.

Description updated
Status changed from Assigned to Feedback

Should we change it?


----------------------------------------
Bug #5527: set_trace_func binding incorrect
https://bugs.ruby-lang.org/issues/5527#change-62774

* Author: Thomas Sawyer
* Status: Feedback
* Priority: Normal
* Assignee: Koichi Sasada
* Target version: next minor
* ruby -v: ruby 1.9.3dev (2011-09-23 revision 33323) [x86_64-linux] 
* Backport: 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN
----------------------------------------
set_trace_func seems to be broken. I traced the issue to the binding
(`b` below). 

```
  $ cat t.rb 
  fn = lambda do |e, f, l, m, b, k| 
    p Kernel.eval('self', b) 
  end 
  set_trace_func(fn) 
  "  a  ".strip 

  $ rbenv shell 1.8.7-p352 
  $ ruby t.rb 
  main 
  "  a  " 
  "  a  " 

  $ rbenv shell 1.9.3-rc1 
  $ ruby t.rb 
  main 
  main 
  main 
  main 
```

It would seem the binding has somehow become the binding-of-caller, rather than receiver.




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

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