summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-21 20:58:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-09-21 20:58:26 +0000
commitfe1ce93f52827f59c069247a6e5998c3a5f907b8 (patch)
treedc68c377c5347844138e9aa22610ee815677a7a4 /vm_dump.c
parent2c34b66e24f1992e2ceca0b8a8f3d710f05f21ae (diff)
downloadbundler-fe1ce93f52827f59c069247a6e5998c3a5f907b8.tar.gz
* compile.c, cont.c, gc.c, insns.def, iseq.c, iseq.h, process.c,
thread.c, vm.c, vm_core.h, vm_dump.c, vm_eval.c, vm_insnhelper.c, vm_method.c, template/insns_info.inc.tmpl, tool/instruction.rb: fixed types. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 3addd9ee32..c9c621fe0e 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -20,11 +20,12 @@
static void
control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
{
- int pc = -1, bp = -1, line = 0;
+ ptrdiff_t pc = -1, bp = -1;
ptrdiff_t lfp = cfp->lfp - th->stack;
ptrdiff_t dfp = cfp->dfp - th->stack;
char lfp_in_heap = ' ', dfp_in_heap = ' ';
char posbuf[MAX_POSBUF+1];
+ int line = 0;
int nopos = 0;
const char *magic, *iseq_name = "-", *selfstr = "-", *biseq_name = "-";
@@ -124,9 +125,9 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
fprintf(stderr, "p:---- ");
}
else {
- fprintf(stderr, "p:%04d ", pc);
+ fprintf(stderr, "p:%04"PRIdPTRDIFF" ", pc);
}
- fprintf(stderr, "s:%04"PRIdPTRDIFF" b:%04d ", (cfp->sp - th->stack), bp);
+ fprintf(stderr, "s:%04"PRIdPTRDIFF" b:%04"PRIdPTRDIFF" ", (cfp->sp - th->stack), bp);
fprintf(stderr, lfp_in_heap == ' ' ? "l:%06"PRIdPTRDIFF" " : "l:%06"PRIxPTRDIFF" ", lfp % 10000);
fprintf(stderr, dfp_in_heap == ' ' ? "d:%06"PRIdPTRDIFF" " : "d:%06"PRIxPTRDIFF" ", dfp % 10000);
fprintf(stderr, "%-6s", magic);
@@ -329,10 +330,10 @@ void
rb_vmdebug_debug_print_register(rb_thread_t *th)
{
rb_control_frame_t *cfp = th->cfp;
- int pc = -1;
- int lfp = cfp->lfp - th->stack;
- int dfp = cfp->dfp - th->stack;
- int cfpi;
+ ptrdiff_t pc = -1;
+ ptrdiff_t lfp = cfp->lfp - th->stack;
+ ptrdiff_t dfp = cfp->dfp - th->stack;
+ ptrdiff_t cfpi;
if (RUBY_VM_NORMAL_ISEQ_P(cfp->iseq)) {
pc = cfp->pc - cfp->iseq->iseq_encoded;
@@ -344,7 +345,7 @@ rb_vmdebug_debug_print_register(rb_thread_t *th)
dfp = -1;
cfpi = ((rb_control_frame_t *)(th->stack + th->stack_size)) - cfp;
- fprintf(stderr, " [PC] %04d, [SP] %04"PRIdPTRDIFF", [LFP] %04d, [DFP] %04d, [CFP] %04d\n",
+ fprintf(stderr, " [PC] %04"PRIdPTRDIFF", [SP] %04"PRIdPTRDIFF", [LFP] %04"PRIdPTRDIFF", [DFP] %04"PRIdPTRDIFF", [CFP] %04"PRIdPTRDIFF"\n",
pc, (cfp->sp - th->stack), lfp, dfp, cfpi);
}
@@ -363,10 +364,12 @@ rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp)
if (iseq != 0 && VM_FRAME_TYPE(cfp) != VM_FRAME_MAGIC_FINISH) {
VALUE *seq = iseq->iseq;
- int pc = cfp->pc - iseq->iseq_encoded;
+ ptrdiff_t pc = cfp->pc - iseq->iseq_encoded;
printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp));
- rb_iseq_disasm_insn(0, seq, pc, iseq, 0);
+ if (pc >= 0) {
+ rb_iseq_disasm_insn(0, seq, (size_t)pc, iseq, 0);
+ }
}
#if VMDEBUG > 3