aboutsummaryrefslogtreecommitdiffstats
path: root/vm_dump.c
diff options
context:
space:
mode:
authortarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 12:01:18 +0000
committertarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-29 12:01:18 +0000
commit44cb6eaef9b189a48d78a0090da78d48e2196fb5 (patch)
treee5c74862a9019a1bdf39fa2bf24a69582a8f5256 /vm_dump.c
parent511cc1db8cb9b4ed2a01758e04b71688f0c25443 (diff)
downloadruby-44cb6eaef9b189a48d78a0090da78d48e2196fb5.tar.gz
* 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. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/vm_dump.c b/vm_dump.c
index b15f17a487..dd28780706 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -349,19 +349,21 @@ rb_vmdebug_thread_dump_regs(VALUE thval)
}
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);