aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_settracefunc.rb
Commit message (Collapse)AuthorAgeFilesLines
...
* Suppress warningsnaruse2012-12-051-32/+36
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: disable trace.ko12012-12-051-0/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c: add TracePoint#inspect.ko12012-12-011-0/+25
| | | | | | | | * test/ruby/test_settracefunc.rb: add a test for this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38132 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c: TracePoint#self returns invoking/exitting thread objectko12012-11-301-4/+13
| | | | | | | | | at thread_begin/end event. * test/ruby/test_settracefunc.rb: fix test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* [EXPERIMENTAL: NEED DISCUSS]ko12012-11-291-1/+56
| | | | | | | | | | | | | | | | | | | | | * vm_trace.c: add events * :thread_begin - hook at thread beggining. * :thead_end - hook at thread ending. * :b_call - hook at block enter. * :b_return - hook at block leave. This change slow down block invocation. Please try and give us feedback until 2.0 code freeze. * include/ruby/ruby.h: ditto. * compile.c (rb_iseq_compile_node): ditto. * insns.def: ditto. * thread.c: ditto. * vm.c: ditto. * include/ruby/debug.h: add a comment. * test/ruby/test_settracefunc.rb: add a tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c (rb_tracepoint_attr_method_id):ko12012-11-291-4/+4
| | | | | | | | | | rename TracePoint#id to TracePoint#method_id. * include/ruby/debug.h: ditto. * test/ruby/test_settracefunc.rb: ditto, git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c (rb_tracepoint_attr_defined_class):ko12012-11-291-2/+2
| | | | | | | | | | | rename TracePoint#klass to TracePoint#defined_class. [ruby-core:50187] Re: [ruby-trunk - Feature #6895] * include/ruby/debug.h: ditto. * test/ruby/test_settracefunc.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c: rename TracePoint#file and TracePoint#lineko12012-11-261-3/+3
| | | | | | | | | | | | to TracePoint#path and TracePoint#lineno respectively. They are consistent to RubyVM::Backtrace::Location. * include/ruby/debug.h: ditto. * vm_core.h: ditto. * test/ruby/test_settracefunc.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c (rb_tracepoint_attr_raised_exception): should not checkko12012-11-241-0/+43
| | | | | | | | | | | value before event checking. * vm_trace.c (rb_tracepoint_attr_return_value): ditto. * test/ruby/test_settracefunc.rb: add tests for TracePoint#return_value and TracePoint#raised_exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove trailing spaces.nobu2012-11-201-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c: rename and add TracePoint APIs.ko12012-11-201-4/+50
| | | | | | | | | | | | | | | | | (1) TracePoint.new(...){...} creates a new trace point but does not make it enable. (2) TracePoint.trace(...){...} creats a new trace point and enable it (same as old behavior). (3) TracePoint#enable make it enable (renamed from TracePoint#retrace). If block given, when enable only in block. (4) TracePoint#disable make it disable (renamed from TracePoint#untrace). If block given, when disable only in block. (5) TracePoint#enabled? returns this trace is enable or not. * test/ruby/test_settracefunc.rb: addd tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c: add two methods:ko12012-11-201-42/+73
| | | | | | | | | | | | | | | | | | | | | (1) TracePoint#return_value which returns return value on the :return and :c_return event. (2) TracePoint#raised_exception which returns raised exception value on the :raise event. Eeach methods raise RuntimeError if it is called at unsupported event. Please review and give us feedback until next preview release (Dec/2012) of Ruby 2.0.0. * insns.def, vm.c, vm_eval.c, vm_insnhelper.c, eval.c, thread.c: ditto. * vm_trace.c, vm_core.h: move definition of rb_trace_arg_t from vm_trace.c to vm_core.h. Caller fills rb_trace_arg_t and pass the pointer of this variable. * test/ruby/test_settracefunc.rb: fix tests to test this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37752 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: remove trailing spaces.ktsj2012-10-211-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_tracepoint):ko12012-10-041-53/+0
| | | | | | | | | remove unused test case. (this test case is redefined by newer tests) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_trace.c: support TracePoint. [ruby-trunk - Feature #6895]ko12012-08-221-0/+218
| | | | | | | | | | | | * test/ruby/test_settracefunc.rb: add tests for above. * proc.c (rb_binding_new_with_cfp): add an internal function. * vm.c (rb_vm_control_frame_id_and_class): add an internal function. * vm_trace.c: add rb_add_event_hook2() and rb_thread_add_event_hook2(). Give us the good name for them! git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36773 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c: add RubyVM::Backtrace object (btobj).ko12012-05-241-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backtrace information contains an array consists of location information for each frames by string. RubyVM::Backtrace object is lightweight backtrace information, which contains complete information to generate traditional style backtrace (an array of strings) with faster generation. If someone accesses to backtrace information via Exception#backtrace, then convert a RubyVM::Backtrace object to traditonal style backtrace. This change causes incompatibility on marshal dumpped binary of Exception. If you have any trouble on it, please tell us before Ruby 2.0 release. Note that RubyVM::Backtrace object should not expose Ruby level. * error.c, eval.c, vm_eval.c: ditto. * internal.h: ditto. * eval_error.c: fix to skip "set_backtrace" method invocation in creating an exception object if it call a normal set_backtrace method (defined by core). * test/ruby/test_settracefunc.rb: fix for above change. * vm_method.c (rb_method_defined_by): added. This function checks that the given object responds with the given method by the given cfunc. * benchmark/bm_vm2_raise1.rb, benchmark/bm_vm2_raise2.rb: add to measure exception creation speed. raise1 create exception objects from shallow stack frame. raise2 create exception objects from deep stack frame. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: ignore traces from another threadsusa2012-05-011-17/+26
| | | | | | | because Kernel.set_trace_func affects other threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): point method name line. [ruby-core:40936]nobu2011-12-131-8/+8
| | | | | | | [Bug #5614] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_bmethod): fix to hook call/return eventko12011-06-301-0/+22
| | | | | | | | | | | | | | | for methods defined by define_method(). * thread.c (call_trace_proc): Fix to skip if class is not given (0). Note that ID and Class object are passed for call/return event if the called method was defined by define_method(). If you are author of tracer/profiler/debugger, this may be an important change. You should check passed class as zero or non-zero instead of checking the event type. * test/ruby/test_settracefunc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (TestSetTraceFunc): ensure to usenobu2011-02-111-6/+10
| | | | | | method_added hook defined in Module. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (thread_reset_event_flags, exec_event_hooks): ignorenobu2010-10-091-0/+12
| | | | | | | | | | | hooks marked as removed. * thread.c (thread_exec_event_hooks): remove hooks to be removed. * thread.c (rb_threadptr_remove_event_hook, rb_remove_event_hook): defer removing hooks if running the hooks. [ruby-dev:42350] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * NEWS: add Thread#add_trace_func and Thread#set_trace_func.wanabe2010-03-261-0/+60
| | | | | | * test/ruby/test_settracefunc.rb (test_thread_trace): add test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, vm.c, vm_eval.c, vm_insnhelper.c: fix issues aboutko12010-01-241-1/+24
| | | | | | | | | | | return and c-return trace. This issue skips (c-)return event with global jump such as break or return. This fix make vm invoke hooks at stack rewind timing. fix [ruby-core:27606] [Bug #2610]. * test/ruby/test_settracefunc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_return, test_return2): add twomame2009-08-181-0/+83
| | | | | | tests for [ruby-dev:38701] and [ruby-core:24463]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_insnhelper.c (vm_call_cfunc): ensure hook c-return.wanabe2009-08-181-0/+2
| | | | | | | | | | [Bug #1588] * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_raise): follow above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24574 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm_core.h (struct rb_iseq_t): add a new field line_no. This fieldmame2009-07-221-3/+3
| | | | | | | | | | | | | | | | represents line number from which the original code of the iseq starts. [ruby-dev:38698] * iseq.c, compile.c: ditto. * parse.y: line number hack (for Proc#source_location) is no longer needed. * test/ruby/test_settracefunc.rb: line number of set_trace_func is now compatible with 1.8's. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (rb_threadptr_exec_event_hooks): new function tonobu2009-07-051-0/+5
| | | | | | | execute event hooks, with preserving errinfo. [ruby-core:24118] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_call, test_class): line numbermame2008-09-301-4/+4
| | | | | | | was changed at r19592. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_call, test_class):nobu2008-08-151-8/+0
| | | | | | | RubyVM::FrozenCore is no longer visible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: fix expected traces formame2008-07-011-14/+24
| | | | | | | RubyVM::FrozenCore's event and r17744. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17787 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_raise): reveal an exceptionmame2008-06-301-2/+6
| | | | | | | hided by rescue modifier. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17744 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * vm.c, vm_core.h,vm_core.h, vm_dump.c, iseq.c: rename class nameko12008-06-291-3/+3
| | | | | | | | | | | | VM -> RubyVM, and rename rb_cVM -> rb_cRubyVM. "VM" is too short name for class. * test/ruby/test_method.rb, test/ruby/test_settracefunc.rb: ditto. * include/ruby/ruby.h: rb_cRubyVM, rb_cEnv, rb_cISeq should not be exposed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: add a test for set_trace_func.mame2008-04-231-0/+4
| | | | | | | | | | | | * test/ruby/envutil.rb: move "rubyexec" method from test_rubyoptions.rb. * test/ruby/test_rubyoptions.rb: use rubyexec in envutil.rb. * test/ruby/test_thread.rb: add tests to achieve over 90% test coverage of thread.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (TestSetTraceFunc#test_raise):nobu2008-02-291-1/+1
| | | | | | | raise is ignored in backtrace now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: fixed tests for set_trace_func.shugo2007-11-121-125/+160
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insnhelper.ci (vm_call_method): pass mn->nd_clss toshugo2007-11-111-1/+1
| | | | | | | | | vm_call_cfunc() instead of klass. * vm.c (rb_thread_method_id_and_klass): traverse parent_iseq. * thread.c (call_trace_proc): use rb_thread_method_id_and_klass(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, node.h, thread.c, yarvcore.[ch], eval_intern.h:ko12007-04-191-0/+2
| | | | | | | | | | | | | | | | | support set_trace_func (incomplete. id and klass don't be passed). And support Thread#set_trace_func which hook only specified thread and Thread#add_trace_func which add new trace func instead of replace old one. C level API was modified. See thread.c (logic) and yarvcore.h (data structures). * vm.c, vm_macro.def: add hook points. * compile.c, insns.def: fix "trace" instruction. * iseq.c, vm_macro.h: add compile option "trace_instruction". * test/ruby/test_settracefunc.rb: hook "c-return" of set_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c (rb_call0): "return" event hook should be always executedshugo2005-04-071-39/+54
| | | | | | | if event_hooks is set. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8262 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (primary): fix lineno of rescue and ensure.shugo2005-03-231-6/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb (test_event): added tests forshugo2005-03-221-12/+111
| | | | | | | "class" and "end" and "raise". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_settracefunc.rb: added test for c-return.shugo2005-03-161-9/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wed Nov 17 23:47:30 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>nahi2004-11-171-0/+26
* test/ruby/test_settracefunc.rb: added. [ruby-dev:24884] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e