summaryrefslogtreecommitdiff
path: root/vm_trace.c
AgeCommit message (Collapse)Author
2013-05-02id.def: predefined IDsnobu
* defs/id.def: add more predefined IDs used in core. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-06prefix global symbolsnobu
* iseq.c (rb_insn_operand_intern): prefix global symbols. * numeric.c (ruby_num_interval_step_size): ditto. * vm_backtrace.c (rb_vm_backtrace_str_ary), (rb_vm_backtrace_location_ary, rb_vm_thread_backtrace), (rb_vm_thread_backtrace_locations): ditto. * vm_trace.c (rb_vm_trace_mark_event_hooks): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39611 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-09* vm_trace.c: Note about TracePoint events set, and comment onzzak
Kernel#set_trace_func to prefer new TracePoint API git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05* proc.c (rb_binding_new_with_cfp): permit to create binding objectko1
of IFUNC frame. When `rb_binding_new_with_cfp()' is called, VM finds out the first normal (has iseq) frame and create a binding object of this frame and create Env objects. `ep's of related frames are updated (`ep's point Env object managed spaces). However, `ep' of skipped IFUNC frame was not updated and old invalid `ep' was remained. It causes serious problems. To solve this issue, permit IFUNC to create binding. (Maybe there is no problem on it) [ruby-dev:46908] [ruby-trunk - Bug #7774] * test/ruby/test_settracefunc.rb: add a test. * vm.c (rb_vm_get_binding_creatable_next_cfp), vm_core.h: added. * vm_trace.c: fix to use `rb_vm_get_binding_creatable_next_cfp()'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* vm_backtrace.c: fix issue of rb_debug_inspector_open().ko1
The order of making binding should be stack (frame) top to bottom. [Bug #7635] And also fix issue of collecting klass. Collecting klass is same as TracePoint#defined_class. (previous version, it returns T_ICLASS (internal objects). * test/-ext-/debug/test_debug.rb: add a test. * ext/-test-/debug/extconf.rb, init.c, inspector.c: ditto. * vm_backtrace.c: remove magic number and add enum CALLER_BINDING_*. * vm_backtrace.c, include/ruby/debug.h: add new C api (experimental) rb_debug_inspector_frame_self_get(). * vm.c, vm_core.h, vm_trace.c: move decl. of rb_vm_control_frame_id_and_class() and constify first parameter. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29vm_trace.c: TracePoint safe level checknobu
* vm_trace.c (rb_tracepoint_enable, rb_tracepoint_disable): check safe level as well as set_trace_func. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29vm_trace.c: trace_func safe level checknobu
* vm_trace.c (set_trace_func, thread_{add,set}_trace_func_m): check safe level as well as 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* include/ruby/ruby.h (RUBY_EVENT_SPECIFIED_LINE): make it special.ko1
This flag is not contained by RUBY_EVENT_TRACEPOINT_ALL. This event is experimental one. It is possible to remove/rename flag name after 2.0.1. * vm_trace.c (get_event_id): return :line if SPECIFIED_LINE was occurred. `:specified_line' never been returned. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-07* vm_trace.c (rb_threadptr_exec_event_hooks_orig): pop tag beforeko1
JUMP_TAG() if frame is `finish' frame. Without this patch, there is an inconsistency between control frame stack and tags stack. [Bug #7668] * test/ruby/test_settracefunc.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-25* vm_trace.c (rb_threadptr_exec_event_hooks_and_pop_frame):ko1
pop a frame before JUMP_TAG() if exception occurred. This change fix bug of Ruby 1.9. [ruby-core:51128] [ruby-trunk - Bug #7624] * vm_core.h (EXEC_EVENT_HOOK_AND_POP_FRAME): add to use `rb_threadptr_exec_event_hooks_and_pop_frame()'. * vm.c (vm_exec): use EXEC_EVENT_HOOK_AND_POP_FRAME() while exception handling. While exception hadnling, if an exception is raised in hooks, need to pop current frame and raise this raised exception by hook. * test/ruby/test_settracefunc.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38601 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* vm_trace.c (tracepoint_new): add code to support specified thread.ko1
But not tested and this feature is not supported officially. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21* vm_core.h, vm_trace.c: fix multi-threading bug for tracing.ko1
Move `trace_arg' from rb_tp_t::trace_arg to rb_thread_t::trace_arg. `trace_arg' may changed by multiple threads. rb_thread_t::trace_arg can represent rb_thread_t::trace_running (null or non-null) and rb_thread_t::trace_running is removed. After that, `rb_tp_t' is not needed to check tracing or not (A running thread knows tracing or not). This is why I remove tp_attr_check_active() and make new function get_trace_arg(). And this modification disable to work the following code: TracePoint.trace{|tp| Thread.new{p tp.event} # access `tp' from other threads. } I believe nobody mix threads at trace procedure. This is current limitation. * cont.c (fiber_switch, rb_cont_call): use rb_thread_t::trace_arg instead of rb_thread_t::trace_running. * test/ruby/test_settracefunc.rb: add a multi-threading test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-21vm_trace.c: stylenobu
* vm_trace.c (rb_suppress_tracing): adjust style. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20 * vm_trace.c (rb_suppress_tracing): remove unused variable 'vm_tracing'tarui
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-20 * vm_trace.c (rb_suppress_tracing): bugfix for vm->trace_runningtarui
counter. And if tracing is already true, vm_trace_running ops is skipped to control overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19 * vm_trace.c (rb_threadptr_exec_event_hooks): get rid of racetarui
condition. [Bug #7589] [ruby-dev:46763] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-19Revert r38371 and r38384. they didn't solve the issuenaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18* vm_trace.c (tracepoint_attr_defined_class): Clean up rdoc forzzak
TracePoint#defined_class git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-17* vm_trace.c (fill_id_and_klass): TracePoint#defined_class returnsko1
singleton class. `set_trace_func' passed attached class (which is attached/modified by singleton class) by 6th block parameter if it is singleton class. Previous behavior follows this spec. However, this method named `defined_class' should return singleton class directly because singleton methods are defined in singleton class. There are no compatible issue because TracePoint is introduced after 2.0. But compatiblity with `set_trace_func' is brokne. This means that you can not replace all `set_trace_func' code with TracePoint without consideration of this behavior. [Bug #7554] * test/ruby/test_settracefunc.rb: change a test to catch up an above chagne. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38430 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14vm_trace.c: suppress warningnobu
* vm_trace.c (exec_hooks): suppress unused-variable warning by RB_UNUSED_VAR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-14* vm_trace.c (exec_hooks): add volatile to avoid segv.naruse
On test-all with -j, it may crash in TH_POP_TAG. Detailed mechanism is not known but this fixes it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-11vm.c: pass exceptions while handling an exceptionnobu
* vm.c (vm_exec): pass exceptions while handling an exception. * vm_trace.c (rb_threadptr_exec_event_hooks): propagate exceptions. revert r38293 partially. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38331 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-10vm_trace.c: exceptions in event hooksnobu
* vm_trace.c (rb_threadptr_exec_event_hooks): exceptions in event hooks should not propagate outside. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06Fix typozzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-06* vm_trace.c: TracePoint#enable should not cause an errorko1
when it is already enabled. TracePoint#disable is too. [ruby-core:50561] [ruby-trunk - Bug #7513] * test/ruby/test_settracefunc.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* vm_trace.c: add TracePoint#inspect.ko1
* 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
2012-12-01* vm_trace.c (rb_tracepoint_new): commit miss.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38131 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01adjust style.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30 [EXPERIMENTAL]ko1
* iseq.c: add following two methods. * ISeq#line_trace_all returns all line traces (line numbers) * ISeq#line_trace_specify(pos, set) set `pos'th line event to specified_line event (if set is true). These features are introduced for debuggers (mainly to make breakpoint). * iseq.h: add decl. of C APIs. * test/ruby/test_iseq.rb: add tests. * vm_trace.c: add `specified_line' event. * include/ruby/ruby.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* vm_trace.c:zzak
tracepoint_attr_return_value (TracePoint#return_value): include `:b_return` for method doc tracepoint_enable_m, tracepoint_disable_m (#enable/#disable): don't have block argument, document block scope git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* vm_trace.c (tracepoint_disable_m, tracepoint_enable_m):ko1
fix block parameter. No arugment should be given to a block which is passed to TracePoint#enable (and disable). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* vm_trace.c: Documentation for TracePoint APIzzak
[ruby-core:47243] [Feature #6895] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30* vm_trace.c (set_trace_func): Formatting of params and eventszzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38037 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29 [EXPERIMENTAL: NEED DISCUSS]ko1
* 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
2012-11-29* include/ruby/debug.h: add rb_debug_inspector_* APIs.ko1
* vm_backtrace.c: ditto. * common.mk: add dpendency from vm_backtrace.o to include/ruby/debug.h. * proc.c (rb_binding_new_with_cfp): constify. * vm.c (rb_vm_get_ruby_level_next_cfp): consitify. * vm_core.h, vm_trace.c: move decls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* include/ruby/debug.h: provide rb_tracearg_*() APIs,ko1
instead of rb_tracepoint_attr_*(). These APIs are for debuggers/profilers. They will be explained in another docs somtime. * vm_trace.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_trace.c (rb_tracepoint_attr_method_id):ko1
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
2012-11-29* vm_trace.c (rb_tracepoint_attr_defined_class):ko1
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
2012-11-26* vm_trace.c: rename TracePoint#file and TracePoint#lineko1
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
2012-11-26* vm_core.h: add members to rb_trace_arg_t:ko1
* `klass_solved' represents klass and id is checked. * `line' represents line calculated from cfp. * `file' represents line calculated from cfp. * vm_trace.c: fix to use above data stractures. No need to calculate klass and id, line and file pairs for each trace points. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-24* vm_trace.c (rb_tracepoint_attr_raised_exception): should not checkko1
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
2012-11-20* include/ruby/debug.h: introdudced.ko1
Debugging/profiling features will be located. * vm_trace.c: expose C-level TracePoint APIs. Note that they are experimental. * vm_trace.c, include/ruby/debug.h: rename `rb_hook_flag_t' to `rb_event_hook_flag_t'. Macro names `RUBY_HOOK_FLAG_*' are also renamed to `RUBY_EVENT_HOOK_FLAG_*'. * debug.h, vm_debug.h: rename debug.h to vm_debug.h. * common.mk: ditto. * debug.c, main.c, vm_core.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-20* vm_trace.c: rename and add TracePoint APIs.ko1
(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
2012-11-20* vm_trace.c: add two methods:ko1
(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
2012-10-23* eval_error.c (error_print), vm_eval.c (eval_string_with_cref),ko1
vm_trace.c (rb_suppress_tracing): use TH_PUSH_TAG() instead of PUSH_TAG(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37305 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21* vm_trace.c (rb_threadptr_exec_event_hooks, rb_suppress_tracing):ktsj
constified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-21* vm_core.h (rb_vm_t::trace_running): add a new fieldktsj
`trace_running' to store vm global tracing status. * vm_trace.c: fix SEGV bug. event_hook was free'd even when the hook is still used in another thread. [ruby-dev:46141] [Bug #7032] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-08internal.h: allocator function in rb_classext_tnobu
* internal.h (struct rb_classext_struct): move allocator function into rb_classext_t from ordinary method table. [ruby-dev:46121] [Feature #6993] * object.c (rb_obj_alloc): call allocator function directly. * vm_method.c (rb_define_alloc_func, rb_undef_alloc_func) (rb_get_alloc_func): use allocator function in rb_classext_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31vm_trace.c: freed memory accessnobu
* vm_trace.c (clean_hooks): do not access freed memory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-31vm_trace.c: uninitialized statenobu
* vm_trace.c (rb_threadptr_exec_event_hooks): fix uninitialized state when no events is excuted. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e