[前][次][番号順一覧][スレッド一覧]

ruby-changes:27116

From: zzak <ko1@a...>
Date: Sat, 9 Feb 2013 13:14:22 +0900 (JST)
Subject: [ruby-changes:27116] zzak:r39168 (trunk): * vm_trace.c: Note about TracePoint events set, and comment on

zzak	2013-02-09 13:14:09 +0900 (Sat, 09 Feb 2013)

  New Revision: 39168

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39168

  Log:
    * vm_trace.c: Note about TracePoint events set, and comment on
      Kernel#set_trace_func to prefer new TracePoint API

  Modified files:
    trunk/ChangeLog
    trunk/vm_trace.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 39167)
+++ ChangeLog	(revision 39168)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Feb  9 13:13:00 2013  Zachary Scott  <zachary@z...>
+
+	* vm_trace.c: Note about TracePoint events set, and comment on
+	  Kernel#set_trace_func to prefer new TracePoint API
+
 Sat Feb  9 10:07:47 2013  Kazuki Tsujimoto  <kazuki@c...>
 
 	* BSDL: update copyright notice for 2013.
Index: vm_trace.c
===================================================================
--- vm_trace.c	(revision 39167)
+++ vm_trace.c	(revision 39168)
@@ -391,6 +391,8 @@ static void call_trace_func(rb_event_fla https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L391
  *  Establishes _proc_ as the handler for tracing, or disables
  *  tracing if the parameter is +nil+.
  *
+ *  *Note:* this method is obsolete, please use TracePoint instead.
+ *
  *  _proc_ takes up to six parameters:
  *
  *  *	an event name
@@ -474,7 +476,8 @@ thread_add_trace_func(rb_thread_t *th, V https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L476
  *     thr.add_trace_func(proc)    -> proc
  *
  *  Adds _proc_ as a handler for tracing.
- *  See <code>Thread#set_trace_func</code> and +set_trace_func+.
+ *
+ *  See Thread#set_trace_func and Kernel#set_trace_func.
  */
 
 static VALUE
@@ -495,7 +498,8 @@ thread_add_trace_func_m(VALUE obj, VALUE https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L498
  *
  *  Establishes _proc_ on _thr_ as the handler for tracing, or
  *  disables tracing if the parameter is +nil+.
- *  See +set_trace_func+.
+ *
+ *  See Kernel#set_trace_func.
  */
 
 static VALUE
@@ -812,7 +816,7 @@ rb_tracearg_raised_exception(rb_trace_ar https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L816
 /*
  * Type of event
  *
- * See TracePoint.new for events
+ * See TracePoint@Events for more information.
  */
 static VALUE
 tracepoint_attr_event(VALUE tpval)
@@ -1149,20 +1153,7 @@ rb_tracepoint_new(VALUE target_thval, rb https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1153
  *
  *	trace.disable
  *
- * To filter what is traced, you can pass any of the following as +events+:
- *
- * +:line+:: execute code on a new line
- * +:class+:: start a class or module definition
- * +:end+:: finish a class or module definition
- * +:call+:: call a Ruby method
- * +:return+:: return from a Ruby method
- * +:c_call+:: call a C-language routine
- * +:c_return+:: return from a C-language routine
- * +:raise+:: raise an exception
- * +:b_call+:: event hook at block entry
- * +:b_return+:: event hook at block ending
- * +:thread_begin+:: event hook at thread beginning
- * +:thread_end+:: event hook at thread ending
+ * See TracePoint@Events for possible events and more information.
  *
  * A block must be given, otherwise a ThreadError is raised.
  *
@@ -1284,7 +1275,7 @@ Init_vm_trace(void) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1275
      * A class that provides the functionality of Kernel#set_trace_func in a
      * nice Object-Oriented API.
      *
-     * = Example
+     * == Example
      *
      * We can use TracePoint to gather information specifically for exceptions:
      *
@@ -1299,7 +1290,29 @@ Init_vm_trace(void) https://github.com/ruby/ruby/blob/trunk/vm_trace.c#L1290
      *	    0 / 0
      *	    #=> [5, :raise, #<ZeroDivisionError: divided by 0>]
      *
-     * See TracePoint.new for possible events.
+     * == Events
+     *
+     * If you don't specify the type of events you want to listen for,
+     * TracePoint will include all available events.
+     *
+     * *Note* do not depend on current event set, as this list is subject to
+     * change. Instead, it is recommended you specify the type of events you
+     * want to use.
+     *
+     * To filter what is traced, you can pass any of the following as +events+:
+     *
+     * +:line+:: execute code on a new line
+     * +:class+:: start a class or module definition
+     * +:end+:: finish a class or module definition
+     * +:call+:: call a Ruby method
+     * +:return+:: return from a Ruby method
+     * +:c_call+:: call a C-language routine
+     * +:c_return+:: return from a C-language routine
+     * +:raise+:: raise an exception
+     * +:b_call+:: event hook at block entry
+     * +:b_return+:: event hook at block ending
+     * +:thread_begin+:: event hook at thread beginning
+     * +:thread_end+:: event hook at thread ending
      *
      */
     rb_cTracePoint = rb_define_class("TracePoint", rb_cObject);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]