summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 03:23:50 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 03:23:50 +0000
commit9256f94d9a27c7a3adf9292b085141e32a4bc247 (patch)
tree87886f6e195816c5edddc18c0c4440fb7bbcf11a /vm_dump.c
parentcf0109cff7f77901a6923ac85cfb4d85b8ee7386 (diff)
* insns.def (DEFINE_INSN): subtract of pointers is ptrdiff_t.
this is not int on 64bit system. * vm_dump.c (control_frame_dump): ditto. * vm_dump.c (stack_dump_each): ditto. * vm_dump.c (debug_print_register): ditto. * vm_dump.c (debug_print_pre): ditto. * transcode.c (str_transcode): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 23413cd..c9e0657 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -21,8 +21,8 @@ static void
control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
{
int pc = -1, bp = -1, line = 0;
- unsigned int lfp = cfp->lfp - th->stack;
- unsigned int dfp = cfp->dfp - th->stack;
+ 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];
@@ -34,11 +34,11 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
}
if (lfp < 0 || lfp > th->stack_size) {
- lfp = (unsigned int)cfp->lfp;
+ lfp = (ptrdiff_t)cfp->lfp;
lfp_in_heap = 'p';
}
if (dfp < 0 || dfp > th->stack_size) {
- dfp = (unsigned int)cfp->dfp;
+ dfp = (ptrdiff_t)cfp->dfp;
dfp_in_heap = 'p';
}
if (cfp->bp) {
@@ -115,7 +115,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
line = -1;
}
- fprintf(stderr, "c:%04d ",
+ fprintf(stderr, "c:%04td ",
(rb_control_frame_t *)(th->stack + th->stack_size) - cfp);
if (pc == -1) {
fprintf(stderr, "p:---- ");
@@ -123,9 +123,9 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
else {
fprintf(stderr, "p:%04d ", pc);
}
- fprintf(stderr, "s:%04d b:%04d ", cfp->sp - th->stack, bp);
- fprintf(stderr, lfp_in_heap == ' ' ? "l:%06d " : "l:%06x ", lfp % 10000);
- fprintf(stderr, dfp_in_heap == ' ' ? "d:%06d " : "d:%06x ", dfp % 10000);
+ fprintf(stderr, "s:%04td b:%04d ", cfp->sp - th->stack, bp);
+ fprintf(stderr, lfp_in_heap == ' ' ? "l:%06td " : "l:%06tx ", lfp % 10000);
+ fprintf(stderr, dfp_in_heap == ' ' ? "d:%06td " : "d:%06tx ", dfp % 10000);
fprintf(stderr, "%-6s ", magic);
if (line) {
fprintf(stderr, "%s", posbuf);
@@ -308,7 +308,7 @@ stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp)
else {
rstr = rb_inspect(*ptr);
}
- fprintf(stderr, " stack %2d: %8s (%d)\n", i, StringValueCStr(rstr),
+ fprintf(stderr, " stack %2d: %8s (%td)\n", i, StringValueCStr(rstr),
ptr - th->stack);
}
}
@@ -345,7 +345,7 @@ 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] %04d, [LFP] %04d, [DFP] %04d, [CFP] %04d\n",
+ fprintf(stderr, " [PC] %04d, [SP] %04td, [LFP] %04d, [DFP] %04d, [CFP] %04d\n",
pc, cfp->sp - th->stack, lfp, dfp, cfpi);
}
@@ -366,7 +366,7 @@ debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp)
VALUE *seq = iseq->iseq;
int pc = cfp->pc - iseq->iseq_encoded;
- printf("%3d ", VM_CFP_CNT(th, cfp));
+ printf("%3td ", VM_CFP_CNT(th, cfp));
ruby_iseq_disasm_insn(0, seq, pc, iseq, 0);
}