 + *  for the integer values. If no mask is specified all events are triggered.
   *
   *      class Test
-  *	def test
-@@ -3922,55 +3990,62 @@
-  *	  line prog.rb:3        test     Test
-  *	  line prog.rb:4        test     Test
+- *	def test
+- *	  a = 1
+- *	  b = 2
+- *	end
++ *      def test
++ *        a = 1
++ *        b = 2
+  *      end
++ *      end
+  *
+  *      set_trace_func proc { |event, file, line, id, binding, classname|
+- *	   printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
++ *         printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
+  *      }
+  *      t = Test.new
+  *      t.test
+  *
+- *	  line prog.rb:11               false
++ *        line prog.rb:11               false
+  *      c-call prog.rb:11        new    Class
+  *      c-call prog.rb:11 initialize   Object
+  *    c-return prog.rb:11 initialize   Object
+  *    c-return prog.rb:11        new    Class
+- *	  line prog.rb:12               false
+- *  	  call prog.rb:2        test     Test
+- *	  line prog.rb:3        test     Test
+- *	  line prog.rb:4        test     Test
++ *        line prog.rb:12               false
++ *        call prog.rb:2        test     Test
++ *        line prog.rb:3        test     Test
++ *        line prog.rb:4        test     Test
   *      return prog.rb:4        test     Test
 + *
 + *      set_trace_func(proc { |event, file, line, id, binding, classname|
-+ *	   printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
++ *         printf "%8s %s:%-2d %10s %8s\n", event, file, line, id, classname
 + *      }, 0x018) # 0x018 == calls and returns only
 + *      t = Test.new
 + *      t.test
 + *
-+ *  	  call prog.rb:2        test     Test
++ *        call prog.rb:2        test     Test
 + *      return prog.rb:4        test     Test
   */
  

 
     /* init thread core */
     Init_native_thread();
Index: eval.c
===================================================================
--- eval.c	(revision 27874)

+    }
+
+    if (NIL_P(trace)) {
+        return Qnil;
+    }
+
+    if (!rb_obj_is_proc(trace)) {
+        rb_raise(rb_eTypeError, "trace_func needs to be Proc");
+    }
+
+    {
+        rb_thread_t *th           = GET_THREAD(); /* main thread */
+        th->trace_skip_insn_count = 2;
+        th->tracing               = -1;
+        rb_add_event_hook(call_trace_func, mask, trace);
+    }
+    
+    return trace;
