Project

General

Profile

Actions

Bug #6490

closed

The 'printf' method in trace_func is not sent to 'stdout' variable in tracer.rb

Added by mfojtik (Michal Fojtik) almost 12 years ago. Updated over 11 years ago.

Status:
Closed
Assignee:
Target version:
ruby -v:
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-darwin11.4.0]
Backport:
[ruby-core:45219]

Description

Hi,

lib/tracer.rb:189

def trace_func(event, file, line, id, binding, klass, *) # :nodoc:
return if file == FILE

for p in @filters
  return unless p.call event, file, line, id, binding, klass
end

return unless Tracer::display_c_call? or
  event != "c-call" && event != "c-return"

Tracer::stdout_mutex.synchronize do
  if EVENT_SYMBOL[event]
    stdout.printf("<%d>", $$) if Tracer::display_process_id?
    stdout.printf("#%d:", get_thread_no) if Tracer::display_thread_id?
    if line == 0
      source = "?\n"
    else
      source = get_line(file, line)
    end
    printf("%s:%d:%s:%s: %s",
           file,
           line,
           klass || '',
           EVENT_SYMBOL[event],
           source)
  end
end

end

As you see, the last 'printf' method is not sent to 'stdout' which unfortunately leads to have the output of Tracer print
always to STDOUT.


Files

0001-Bug-6490.patch (996 Bytes) 0001-Bug-6490.patch mfojtik (Michal Fojtik), 05/25/2012 07:19 AM
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0