From: daz Date: 2003-06-01T14:39:42+09:00 Subject: 'line' trace event (was Re: IF statement in ruby 1.8.0 ......) "Yukihiro Matsumoto" wrote: > > |> This could be 'bug-lite' in 1.7+ (or i386)? > | > |Bug or a feature ? ;-) > > A feature. This is added to accomplish better debugger tracing. > The call timing may be changed in the future. > > matz. > < abbreviated ri 1.8 description> ------------------------------------------------- Kernel::set_trace_func set_trace_func( aProc ) -> aProc set_trace_func( nil ) -> nil ------------------------------------------------------------------------ Events are: c-call, c-return, call , class, end, line (execute code on a new line), raise and return. puts "ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]" set_trace_func proc {| ev, fi, li, oi, bi, cl | printf("(%8s) %s:%-2d (%10s) %s %8s\n", ev, fi[-11,11], li, oi.inspect, bi.to_s, cl) if ev == 'line' } ##- line 7 a = 1 a = 2 if true if true then a = 3 end a -= 1 while a > 0 produces:- ruby 1.8.0 (2003-05-15) [i386-mswin32] ( line) stf_line.rb:8 ( nil) # false ( line) stf_line.rb:10 ( nil) # false ( line) stf_line.rb:10 ( nil) # false ( line) stf_line.rb:11 ( nil) # false ( line) stf_line.rb:11 ( nil) # false ( line) stf_line.rb:11 ( nil) # false ( line) stf_line.rb:12 ( nil) # false Perhaps if calls other than the first were 'line+', the debugger could accept 'line' and 'line+' while others could easily filter out the extra detail. We're not all 'node-dumpers' :-) Very many thanks, Matz, daz -- "Not only that: He's handed out the fkn source code as well!"