Project

General

Profile

Actions

Bug #4583

closed

trace doesn't work for methods set up by attr_*

Added by QaDeS (Michael Klaus) about 13 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
-
ruby -v:
-
Backport:
[ruby-core:35790]

Description

=begin
Methods set up with (({attr_accessor})) or alike are not traceable:

class Foo
attr_writer :bar
def baz=(value)
@baz = value
end
end

set_trace_func proc{|*args| puts args.inspect}
@foo = Foo.new # will be traced
@foo.bar = 'bar' # call to bar= will not be traced
@foo.baz = 'baz' # call to baz= will be traced

Expected behavior: "c-call" and "c-return" are traced.

=end


Files

eval.diff (2.29 KB) eval.diff trace events to attr_* generated methods. includes test QaDeS (Michael Klaus), 04/17/2011 04:17 PM
test_settracefunc.rb.diff (1.4 KB) test_settracefunc.rb.diff 1.9.2-head Testing trace events for attr_* generated methods QaDeS (Michael Klaus), 04/17/2011 07:05 PM
trace_attr_accessors.patch (2.32 KB) trace_attr_accessors.patch 1.9.2 Full working patch QaDeS (Michael Klaus), 04/18/2011 06:24 AM
test_settracefunc-1.8.7.patch (2.08 KB) test_settracefunc-1.8.7.patch 1.8.7 Test for correct binding - succeeds QaDeS (Michael Klaus), 04/18/2011 07:56 AM
test_settracefunc-1.9.2.patch (2.27 KB) test_settracefunc-1.9.2.patch 1.9.2 Test for correct binding - fails QaDeS (Michael Klaus), 04/18/2011 07:56 AM

Related issues 1 (0 open1 closed)

Related to Ruby 1.8 - Bug #4584: trace doesn't work for methods set up by attr_*Rejected04/17/2011Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0Like0Like0