summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 04:05:36 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-09-28 04:05:36 +0000
commitd50483df23383caf098c23c25c133f4eefca5917 (patch)
treed2e94e5ec61e548687a0b67d06a0662063650a31 /vm_dump.c
parent8124d67988ea5aa995f1721446c229a83a8b356d (diff)
downloadruby-d50483df23383caf098c23c25c133f4eefca5917.tar.gz
* vm_core.h: remove rb_control_frame_t::bp (bp: base pointer).
`bp' can be calculate by `sp' (stack pointer) of previous frame. Now, `bp_check' field is remained for debug. You can eliminate this field by setting VM_DEBUG_BP_CHECK as 0. * vm_insnhelper.c (vm_base_ptr): add `vm_base_ptr(cfp). This function calculates base pointer from cfp. * vm_insnhelper.c (vm_setup_method): push `recv' value on top of value stack (before method parameters). This change is for keeping consistency with normal method dispatch. * insns.def: fix to use vm_base_ptr(). * vm.c (vm_exec): ditto. * vm_dump.c: remove `bp' related dumps. * cont.c (fiber_init): fix to check VM_DEBUG_BP_CHECK. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/vm_dump.c b/vm_dump.c
index 99da986d7e..4f7525e8a9 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -27,7 +27,7 @@
static void
control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
{
- ptrdiff_t pc = -1, bp = -1;
+ ptrdiff_t pc = -1;
ptrdiff_t ep = cfp->ep - th->stack;
char ep_in_heap = ' ';
char posbuf[MAX_POSBUF+1];
@@ -44,9 +44,6 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
ep = (ptrdiff_t)cfp->ep;
ep_in_heap = 'p';
}
- if (cfp->bp) {
- bp = cfp->bp - th->stack;
- }
switch (VM_FRAME_TYPE(cfp)) {
case VM_FRAME_MAGIC_TOP:
@@ -119,7 +116,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
else {
fprintf(stderr, "p:%04"PRIdPTRDIFF" ", pc);
}
- fprintf(stderr, "s:%04"PRIdPTRDIFF" b:%04"PRIdPTRDIFF" ", (cfp->sp - th->stack), bp);
+ fprintf(stderr, "s:%04"PRIdPTRDIFF" ", cfp->sp - th->stack);
fprintf(stderr, ep_in_heap == ' ' ? "e:%06"PRIdPTRDIFF" " : "e:%06"PRIxPTRDIFF" ", ep % 10000);
fprintf(stderr, "%-6s", magic);
if (line) {
@@ -141,7 +138,7 @@ void
rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
{
#if 0
- VALUE *sp = cfp->sp, *bp = cfp->bp, *ep = cfp->ep;
+ VALUE *sp = cfp->sp, *ep = cfp->ep;
VALUE *p, *st, *t;
fprintf(stderr, "-- stack frame ------------\n");
@@ -155,8 +152,6 @@ rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
if (p == ep)
fprintf(stderr, " <- ep");
- if (p == bp)
- fprintf(stderr, " <- bp"); /* should not be */
fprintf(stderr, "\n");
}