set_trace_func Provides a callback whenever the interpreter calls a method, evaluates a statement, etc. Used by the debugger for breakpoints, watchpoints, etc. 1 def foo; puts "foo!"; end 2 set_trace_func proc { |*x| p x } 3 foo()