ruby-changes:31837
From: tarui <ko1@a...>
Date: Fri, 29 Nov 2013 21:01:27 +0900 (JST)
Subject: [ruby-changes:31837] tarui:r43916 (trunk): * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly.
tarui 2013-11-29 21:01:18 +0900 (Fri, 29 Nov 2013) New Revision: 43916 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43916 Log: * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly. PC is cached into local stack and cfp->pc is incorrent at next of branch or jump. * vm_exec.h (DEBUG_ENTER_INSN): catch up this change. * vm_core.h: update signature of rb_vmdebug_debug_print_pre. Modified files: trunk/ChangeLog trunk/vm_core.h trunk/vm_dump.c trunk/vm_exec.h Index: ChangeLog =================================================================== --- ChangeLog (revision 43915) +++ ChangeLog (revision 43916) @@ -1,6 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Fri Nov 29 20:59:39 2013 Masaya Tarui <tarui@r...> + + * vm_dump.c (rb_vmdebug_debug_print_pre): Bugfix. Get PC directly. + PC is cached into local stack and cfp->pc is incorrent at next of + branch or jump. + * vm_exec.h (DEBUG_ENTER_INSN): catch up this change. + * vm_core.h: update signature of rb_vmdebug_debug_print_pre. + Fri Nov 29 20:43:57 2013 Masaya Tarui <tarui@r...> - * compile.c : Bugsfix for dump_disasm_list. + * compile.c: Bugsfix for dump_disasm_list. rb_inspect denies a hidden object. So, insert rapper that creates the unhidden one. adjust->label is null sometimes. Index: vm_core.h =================================================================== --- vm_core.h (revision 43915) +++ vm_core.h (revision 43916) @@ -840,7 +840,7 @@ VALUE rb_proc_alloc(VALUE klass); https://github.com/ruby/ruby/blob/trunk/vm_core.h#L840 /* for debug */ extern void rb_vmdebug_stack_dump_raw(rb_thread_t *, rb_control_frame_t *); -extern void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp); +extern void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp, VALUE *_pc); extern void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp); #define SDR() rb_vmdebug_stack_dump_raw(GET_THREAD(), GET_THREAD()->cfp) Index: vm_exec.h =================================================================== --- vm_exec.h (revision 43915) +++ vm_exec.h (revision 43916) @@ -27,7 +27,7 @@ typedef rb_iseq_t *ISEQ; https://github.com/ruby/ruby/blob/trunk/vm_exec.h#L27 #if VMDEBUG > 0 #define debugs printf #define DEBUG_ENTER_INSN(insn) \ - rb_vmdebug_debug_print_pre(th, GET_CFP()); + rb_vmdebug_debug_print_pre(th, GET_CFP(),GET_PC()); #if OPT_STACK_CACHING #define SC_REGS() , reg_a, reg_b Index: vm_dump.c =================================================================== --- vm_dump.c (revision 43915) +++ vm_dump.c (revision 43916) @@ -349,19 +349,21 @@ rb_vmdebug_thread_dump_regs(VALUE thval) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L349 } void -rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp) +rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp,VALUE *_pc) { rb_iseq_t *iseq = cfp->iseq; if (iseq != 0) { VALUE *seq = iseq->iseq; - ptrdiff_t pc = cfp->pc - iseq->iseq_encoded; + ptrdiff_t pc = _pc - iseq->iseq_encoded; int i; for (i=0; i<(int)VM_CFP_CNT(th, cfp); i++) { printf(" "); } printf("| "); + if(0)printf("[%03ld] ",cfp->sp - th->stack); + /* printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); */ if (pc >= 0) { rb_iseq_disasm_insn(0, seq, (size_t)pc, iseq, 0); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/