tracer main class
Symbol table used for displaying trace information
Reference to singleton instance of Tracer
display C-routine calls in trace output (defaults to false)
display C-routine calls in trace output (defaults to false)
display process id in trace output (defaults to false)
display process id in trace output (defaults to false)
display thread id in trace output (defaults to true)
display thread id in trace output (defaults to true)
output stream used to output trace (defaults to STDOUT)
mutex lock used by tracer for displaying trace output
display additional debug information (defaults to false)
display additional debug information (defaults to false)
Used to filter unwanted trace output
Example which only outputs lines of code executed within the Kernel class:
Tracer.add_filter do |event, file, line, id, binding, klass, *rest| "Kernel" == klass.to_s end
# File rake/lib/tracer.rb, line 275 def Tracer.add_filter(p = proc) Single.add_filter(p) end
Disable tracing
# File rake/lib/tracer.rb, line 248 def Tracer.off Single.off end
Register an event handler p
which is called everytime a line
in file_name
is executed.
Example:
Tracer.set_get_line_procs("example.rb", lambda { |line| puts "line number executed is #{line}" })
# File rake/lib/tracer.rb, line 262 def Tracer.set_get_line_procs(file_name, p = proc) Single.set_get_line_procs(file_name, p) end
# File rake/lib/debug.rb, line 16 def Tracer.trace_func(*vars) Single.trace_func(*vars) end