ruby-changes:27185
From: zzak <ko1@a...>
Date: Thu, 14 Feb 2013 13:17:43 +0900 (JST)
Subject: [ruby-changes:27185] zzak:r39237 (ruby_2_0_0): * Backport r39168 Warning about TracePoint events to 2.0.0
zzak 2013-02-14 13:17:29 +0900 (Thu, 14 Feb 2013) New Revision: 39237 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=39237 Log: * Backport r39168 Warning about TracePoint events to 2.0.0 [ruby-core:52073] [Bug #7815] * vm_trace.c: note about TracePoint events set Modified files: branches/ruby_2_0_0/ChangeLog branches/ruby_2_0_0/vm_trace.c Index: ruby_2_0_0/ChangeLog =================================================================== --- ruby_2_0_0/ChangeLog (revision 39236) +++ ruby_2_0_0/ChangeLog (revision 39237) @@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1 +Thu Feb 14 13:17:10 2013 Zachary Scott <zachary@z...> + + * Backport r39168 Warning about TracePoint events to 2.0.0 + [ruby-core:52073] [Bug #7815] + + * vm_trace.c: note about TracePoint events set + Thu Feb 14 07:04:13 2013 Eric Hodel <drbrain@s...> * Backport r39213 from trunk [ruby-trunk - Bug #7383] Index: ruby_2_0_0/vm_trace.c =================================================================== --- ruby_2_0_0/vm_trace.c (revision 39236) +++ ruby_2_0_0/vm_trace.c (revision 39237) @@ -812,7 +812,7 @@ rb_tracearg_raised_exception(rb_trace_ar https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_trace.c#L812 /* * Type of event * - * See TracePoint.new for events + * See TracePoint@Events for more information. */ static VALUE tracepoint_attr_event(VALUE tpval) @@ -1149,20 +1149,7 @@ rb_tracepoint_new(VALUE target_thval, rb https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_trace.c#L1149 * * 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 +1271,7 @@ Init_vm_trace(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_trace.c#L1271 * 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 +1286,29 @@ Init_vm_trace(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/vm_trace.c#L1286 * 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/