summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
AgeCommit message (Collapse)Author
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-28vm_backtrace.c: use longnobu
* vm_backtrace.c (rb_debug_inspector_frame_{class,binding,iseq}_get): use long as index as well as RARRAY_LEN(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-31* vm_backtrace.c: Add documentation for Kernel#caller_locations,zzak
Kernel#caller, and Thread::Backtrace::Location git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-03* vm_backtrace.c (vm_backtrace_to_ary): check negative size (2nd arg).ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01* vm_backtrace.c (location_inspect_m): addko1
Thread::Backtrace::Location#inspect. It same as loc_obj.to_s.inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30vm_backtrace.c: suppress warningnobu
* vm_backtrace.c (rb_debug_inspector_open): suppress uninitialized-variable warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-30vm_backtrace.c: RB_GC_GUARDnobu
* include/ruby/ruby.h (RB_GC_GUARD_PTR): add note. * vm_backtrace.c (backtrace_to_str_ary): use RB_GC_GUARD() instead of RB_GC_GUARD_PTR() which has no effect. (backtrace_to_location_ary): ditto. (vm_backtrace_to_ary): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38015 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_backtrace.c: add GC guards.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29remove trainling spacesnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37983 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_backtrace.c (rb_debug_inspector_open): use RARRAY_LENINT() forko1
int variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37980 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* vm_backtrace.c: same as a last patch.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_backtrace.c: use `long' for return values of `NUM2LONG()'.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-29* vm_backtrace.c (vm_backtrace_to_ary): support range argumentko1
like Array#[]. [ruby-core:50092] [ruby-trunk - Feature #7434] Test and document is not available. Please help us. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28* vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary.ko1
* vm_backtrace.c (rb_backtrace_to_str_ary): use `backtrace_to_str_ary()'. * vm_backtrace.c (backtrace_to_frame_ary): rename to backtrace_to_location_ary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28* vm_backtrace.c: rename Class name fromko1
::RubyVM::Backtrace and ::RubyVM::Backtrace::Location to ::Thread::Backtrace and ::Thread::Backtrace::Location. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-28* vm_core.h (enum rb_thread_status): remove THREAD_TO_KILLkosaki
* vm_core.h (struct rb_thread_struct): add to_kill field * thread.c (terminate_i): convert THREAD_TO_KILL to to_kill. * thread.c (rb_threadptr_to_kill): ditto. * thread.c (rb_thread_kill): ditto. * thread.c (rb_thread_wakeup_alive): ditto. * thread.c (thread_list_i): ditto. * thread.c (static const char): ditto. * thread.c (thread_status_name): ditto. * thread.c (rb_thread_status): ditto. * thread.c (rb_thread_inspect): ditto. * vm_backtrace.c (thread_backtrace_to_ary): ditto. * thread.c (rb_threadptr_execute_interrupts): fix thread status overwritten issue. [Bug #7450] [ruby-core:50249] * test/ruby/test_thread.rb (test_hread_status_raise_after_kill): test for the above. * test/ruby/test_thread.rb (test_thread_status_in_trap): test for thread status in trap. * test/ruby/test_thread.rb (test_status_and_stop_p): remove Thread.control_interrupt unsafe test. Thread#kill no longer changes thread status. Instead of, Thread#kill receiver changes their own status when receiving kill signal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-19* vm_backtrace.c (vm_backtrace_to_ary): fix a typo of an variable name.nagachika
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-19* thread.c: add `Thread#backtrace_locations' method.ko1
This method is similart to `caller_locations' method for specific method. And fix to accept `level' and `n' parameters for `Thread#backtrace' and `Thread#backtrace_locations'. `caller' (and `caller_locations') do not return `caller' method frame. However, `Thread#backtrace' (and `Thread#backtrace_locations') return `Thread#backtrace' method frame itself if `Thread.current.backtrace' was called. * vm_backtrace.c: ditto. * internal.h: ditto. * test/ruby/test_backtrace.rb: add tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37716 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-06-15* vm_backtrace.c (backtrace_collect): rename from backtreace_collectkazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-15* vm_core.h: remove VM_FRAME_MAGIC_FINISH (finish frame type).ko1
Before this commit: `finish frame' was place holder which indicates that VM loop needs to return function. If a C method calls a Ruby methods (a method written by Ruby), then VM loop will be (re-)invoked. When the Ruby method returns, then also VM loop should be escaped. `finish frame' has only one instruction `finish', which returns VM loop function. VM loop function executes `finish' instruction, then VM loop function returns itself. With such mechanism, `leave' instruction (which returns one frame from current scope) doesn't need to check that this `leave' should also return from VM loop function. Strictly, one branch can be removed from `leave' instructon. Consideration: However, pushing the `finish frame' needs costs because it needs several memory accesses. The number of pushing `finish frame' is greater than I had assumed. Of course, pushing `finish frame' consumes additional control frame. Moreover, recent processors has good branch prediction, with which we can ignore such trivial checking. After this commit: Finally, I decide to remove `finish frame' and `finish' instruction. Some parts of VM depend on `finish frame', so the new frame flag VM_FRAME_FLAG_FINISH is introduced. If this frame should escape from VM function loop, then the result of VM_FRAME_TYPE_FINISH_P(cfp) is true. `leave' instruction checks this flag every time. I measured performance on it. However on my environments, it improves some benchmarks and slows some benchmarks down. Maybe it is because of C compiler optimization parameters. I'll re-visit here if this cause problems. * insns.def (leave, finish): remove finish instruction. * vm.c, vm_eval.c, vm_exec.c, vm_backtrace.c, vm_dump.c: apply above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-11 * compile.c (iseq_set_sequence): nonstatic initializer of anshyouhei
aggregate type is a C99ism. * compile.c (enum compile_array_type_t): comma at the end of enum list is a C99ism. * vm_backtrace.c (enum LOCATION_TYPE): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-08* remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-04* vm_core.h (rb_location_t): fix type and field name.ko1
(1) rename rb_location_t to rb_iseq_location_t. (2) rename field names of rb_iseq_location_t to adjust RubyVM::Backtrace::Location methods. (2-1) filename -> path (2-2) filepath -> absolute_path (2-3) basename -> base_label (2-4) name -> label (3) rename filed name rb_iseq_location_t#line_no to rb_iseq_location_t#first_lineno to clear purpose of this field. (4) The field names rb_binding_t#(filename|line_no) are also renamed to rb_binding_t#(path|first_lineno). * compile.c: apply above changes. * iseq.c: ditto. * proc.c: ditto. * vm*.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02* vm_backtrace.c: change names.ko1
(1) Class name: RubyVM::FrameInfo -> RubyVM::Backtrace::Location. (2) Method name: RubyVM::FrameInfo.caller -> Kernel.caller_locations. (3) Instance methods of RubyVM::FrameInfo (RubyVM::Backtrace::Location) (3-1) name -> label (3-2) basename -> base_label (basename is confusing with File.basename) (3-3) line_no -> lineno (We have already similar name File#lineno, commented by kou [ruby-dev:45686]). (3-4) filename -> path. (3-5) filepath -> absolute_path. (3-5) iseq -> removed (we will make other APIs to access iseq and other information of frame for debugging). * test/ruby/test_backtrace.rb: apply above changes. And apply comment from kou [ruby-dev:45686]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02* common.mk: fix to build vm_backtrace.c only itself (vm_backtrace.cko1
is no longer included from vm.c). I hope this separation reduce compile time of vm.c. * internal.h: ditto. * vm.c, vm_core.h, vm_dump.c, vm_eval.c: ditto. * vm_eval.c: some functions (callee, etc) moved to vm_backtrace.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-02* vm_backtrace.c: added. Separate backtrace related functions toko1
this file. * vm.c, common.mk: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e