@@ -391,6 +391,8 @@ static void call_trace_func(rb_event_flag_t, VALUE data, VALUE self, ID id, VALU
391
391
* Establishes _proc_ as the handler for tracing, or disables
392
392
* tracing if the parameter is +nil+.
393
393
*
394
+ * *Note:* this method is obsolete, please use TracePoint instead.
395
+ *
394
396
* _proc_ takes up to six parameters:
395
397
*
396
398
* * an event name
@@ -474,7 +476,8 @@ thread_add_trace_func(rb_thread_t *th, VALUE trace)
474
476
* thr.add_trace_func(proc) -> proc
475
477
*
476
478
* Adds _proc_ as a handler for tracing.
477
- * See <code>Thread#set_trace_func</code> and +set_trace_func+.
479
+ *
480
+ * See Thread#set_trace_func and Kernel#set_trace_func.
478
481
*/
479
482
480
483
static VALUE
@@ -495,7 +498,8 @@ thread_add_trace_func_m(VALUE obj, VALUE trace)
495
498
*
496
499
* Establishes _proc_ on _thr_ as the handler for tracing, or
497
500
* disables tracing if the parameter is +nil+.
498
- * See +set_trace_func+.
501
+ *
502
+ * See Kernel#set_trace_func.
499
503
*/
500
504
501
505
static VALUE
@@ -812,7 +816,7 @@ rb_tracearg_raised_exception(rb_trace_arg_t *trace_arg)
812
816
/*
813
817
* Type of event
814
818
*
815
- * See TracePoint.new for events
819
+ * See TracePoint@Events for more information.
816
820
*/
817
821
static VALUE
818
822
tracepoint_attr_event (VALUE tpval )
@@ -1149,20 +1153,7 @@ rb_tracepoint_new(VALUE target_thval, rb_event_flag_t events, void (*func)(VALUE
1149
1153
*
1150
1154
* trace.disable
1151
1155
*
1152
- * To filter what is traced, you can pass any of the following as +events+:
1153
- *
1154
- * +:line+:: execute code on a new line
1155
- * +:class+:: start a class or module definition
1156
- * +:end+:: finish a class or module definition
1157
- * +:call+:: call a Ruby method
1158
- * +:return+:: return from a Ruby method
1159
- * +:c_call+:: call a C-language routine
1160
- * +:c_return+:: return from a C-language routine
1161
- * +:raise+:: raise an exception
1162
- * +:b_call+:: event hook at block entry
1163
- * +:b_return+:: event hook at block ending
1164
- * +:thread_begin+:: event hook at thread beginning
1165
- * +:thread_end+:: event hook at thread ending
1156
+ * See TracePoint@Events for possible events and more information.
1166
1157
*
1167
1158
* A block must be given, otherwise a ThreadError is raised.
1168
1159
*
@@ -1284,7 +1275,7 @@ Init_vm_trace(void)
1284
1275
* A class that provides the functionality of Kernel#set_trace_func in a
1285
1276
* nice Object-Oriented API.
1286
1277
*
1287
- * = Example
1278
+ * == Example
1288
1279
*
1289
1280
* We can use TracePoint to gather information specifically for exceptions:
1290
1281
*
@@ -1299,7 +1290,29 @@ Init_vm_trace(void)
1299
1290
* 0 / 0
1300
1291
* #=> [5, :raise, #<ZeroDivisionError: divided by 0>]
1301
1292
*
1302
- * See TracePoint.new for possible events.
1293
+ * == Events
1294
+ *
1295
+ * If you don't specify the type of events you want to listen for,
1296
+ * TracePoint will include all available events.
1297
+ *
1298
+ * *Note* do not depend on current event set, as this list is subject to
1299
+ * change. Instead, it is recommended you specify the type of events you
1300
+ * want to use.
1301
+ *
1302
+ * To filter what is traced, you can pass any of the following as +events+:
1303
+ *
1304
+ * +:line+:: execute code on a new line
1305
+ * +:class+:: start a class or module definition
1306
+ * +:end+:: finish a class or module definition
1307
+ * +:call+:: call a Ruby method
1308
+ * +:return+:: return from a Ruby method
1309
+ * +:c_call+:: call a C-language routine
1310
+ * +:c_return+:: return from a C-language routine
1311
+ * +:raise+:: raise an exception
1312
+ * +:b_call+:: event hook at block entry
1313
+ * +:b_return+:: event hook at block ending
1314
+ * +:thread_begin+:: event hook at thread beginning
1315
+ * +:thread_end+:: event hook at thread ending
1303
1316
*
1304
1317
*/
1305
1318
rb_cTracePoint = rb_define_class ("TracePoint" , rb_cObject );
0 commit comments