void rb_vmdebug_debug_print_post(rb_thread_t *th, rb_control_frame_t *cfp #if OPT_STACK_CACHING , VALUE reg_a, VALUE reg_b #endif ) { #if VMDEBUG > 9 SDR2(cfp); #endif #if VMDEBUG > 3 fprintf(stderr, " (2)"); rb_vmdebug_debug_print_register(th); #endif /* stack_dump_raw(th, cfp); */ #if VMDEBUG > 2 /* stack_dump_thobj(th); */ vm_stack_dump_each(th, th->cfp); #if OPT_STACK_CACHING { VALUE rstr; rstr = rb_inspect(reg_a); fprintf(stderr, " sc reg A: %s\n", StringValueCStr(rstr)); rstr = rb_inspect(reg_b); fprintf(stderr, " sc reg B: %s\n", StringValueCStr(rstr)); } #endif printf ("--------------------------------------------------------------\n"); #endif }
void rb_vmdebug_thread_dump_regs(VALUE thval) { rb_thread_t *th; GetThreadPtr(thval, th); rb_vmdebug_debug_print_register(th); }
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp,VALUE *_pc) { const rb_iseq_t *iseq = cfp->iseq; if (iseq != 0) { ptrdiff_t pc = _pc - iseq->body->iseq_encoded; int i; for (i=0; i<(int)VM_CFP_CNT(th, cfp); i++) { printf(" "); } printf("| "); if(0)printf("[%03ld] ", (long)(cfp->sp - th->stack)); /* printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); */ if (pc >= 0) { const VALUE *iseq_original = rb_iseq_original_iseq((rb_iseq_t *)iseq); rb_iseq_disasm_insn(0, iseq_original, (size_t)pc, iseq, 0); } } #if VMDEBUG > 3 fprintf(stderr, " (1)"); rb_vmdebug_debug_print_register(th); #endif }
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp) { rb_iseq_t *iseq = cfp->iseq; if (iseq != 0) { VALUE *seq = iseq->iseq; ptrdiff_t pc = cfp->pc - iseq->iseq_encoded; int i; for (i=0; i<(int)VM_CFP_CNT(th, cfp); i++) { printf(" "); } printf("| "); /* printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); */ if (pc >= 0) { rb_iseq_disasm_insn(0, seq, (size_t)pc, iseq, 0); } } #if VMDEBUG > 3 fprintf(stderr, " (1)"); rb_vmdebug_debug_print_register(th); #endif }
void rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp) { rb_iseq_t *iseq = cfp->iseq; if (iseq != 0 && VM_FRAME_TYPE(cfp) != VM_FRAME_MAGIC_FINISH) { VALUE *seq = iseq->iseq; int pc = cfp->pc - iseq->iseq_encoded; printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); rb_iseq_disasm_insn(0, seq, pc, iseq, 0); } #if VMDEBUG > 3 fprintf(stderr, " (1)"); rb_vmdebug_debug_print_register(th); #endif }