summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-10 04:55:12 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-10 04:55:12 (GMT)
commit6881279149bb452ed1787cdf60c8e614178c0b6a (patch)
tree2f9f2f81a57cb986b724d87959260d27de12da54 /vm_dump.c
parent25213719c21ed53ab4fc5c24193d83dfe93c1c4e (diff)
rename rb_execution_context_t::stack(_size) to vm_stack(_size).
* vm_core.h: Ruby processes run with two stacks, a machine stack and a VM stack. To make it clear, this fix renames rb_execution_context_t::stack(_size) to vm_stack(_size). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59563 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/vm_dump.c b/vm_dump.c
index dbd9c6b..37028a2 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -22,14 +22,14 @@
#define MAX_POSBUF 128
#define VM_CFP_CNT(th, cfp) \
- ((rb_control_frame_t *)((th)->ec.stack + (th)->ec.stack_size) - \
+ ((rb_control_frame_t *)((th)->ec.vm_stack + (th)->ec.vm_stack_size) - \
(rb_control_frame_t *)(cfp))
static void
control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
{
ptrdiff_t pc = -1;
- ptrdiff_t ep = cfp->ep - th->ec.stack;
+ ptrdiff_t ep = cfp->ep - th->ec.vm_stack;
char ep_in_heap = ' ';
char posbuf[MAX_POSBUF+1];
int line = 0;
@@ -39,7 +39,7 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
const rb_callable_method_entry_t *me;
- if (ep < 0 || (size_t)ep > th->ec.stack_size) {
+ if (ep < 0 || (size_t)ep > th->ec.vm_stack_size) {
ep = (ptrdiff_t)cfp->ep;
ep_in_heap = 'p';
}
@@ -112,14 +112,14 @@ control_frame_dump(rb_thread_t *th, rb_control_frame_t *cfp)
}
fprintf(stderr, "c:%04"PRIdPTRDIFF" ",
- ((rb_control_frame_t *)(th->ec.stack + th->ec.stack_size) - cfp));
+ ((rb_control_frame_t *)(th->ec.vm_stack + th->ec.vm_stack_size) - cfp));
if (pc == -1) {
fprintf(stderr, "p:---- ");
}
else {
fprintf(stderr, "p:%04"PRIdPTRDIFF" ", pc);
}
- fprintf(stderr, "s:%04"PRIdPTRDIFF" ", cfp->sp - th->ec.stack);
+ fprintf(stderr, "s:%04"PRIdPTRDIFF" ", cfp->sp - th->ec.vm_stack);
fprintf(stderr, ep_in_heap == ' ' ? "e:%06"PRIdPTRDIFF" " : "E:%06"PRIxPTRDIFF" ", ep % 10000);
fprintf(stderr, "%-6s", magic);
if (line) {
@@ -145,12 +145,12 @@ rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
VALUE *p, *st, *t;
fprintf(stderr, "-- stack frame ------------\n");
- for (p = st = th->ec.stack; p < sp; p++) {
+ for (p = st = th->ec.vm_stack; p < sp; p++) {
fprintf(stderr, "%04ld (%p): %08"PRIxVALUE, (long)(p - st), p, *p);
t = (VALUE *)*p;
- if (th->ec.stack <= t && t < sp) {
- fprintf(stderr, " (= %ld)", (long)((VALUE *)GC_GUARDED_PTR_REF(t) - th->ec.stack));
+ if (th->ec.vm_stack <= t && t < sp) {
+ fprintf(stderr, " (= %ld)", (long)((VALUE *)GC_GUARDED_PTR_REF(t) - th->ec.vm_stack));
}
if (p == ep)
@@ -162,7 +162,7 @@ rb_vmdebug_stack_dump_raw(rb_thread_t *th, rb_control_frame_t *cfp)
fprintf(stderr, "-- Control frame information "
"-----------------------------------------------\n");
- while ((void *)cfp < (void *)(th->ec.stack + th->ec.stack_size)) {
+ while ((void *)cfp < (void *)(th->ec.vm_stack + th->ec.vm_stack_size)) {
control_frame_dump(th, cfp);
cfp++;
}
@@ -285,7 +285,7 @@ vm_stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp)
break;
}
fprintf(stderr, " stack %2d: %8s (%"PRIdPTRDIFF")\n", i, StringValueCStr(rstr),
- (ptr - th->ec.stack));
+ (ptr - th->ec.vm_stack));
}
}
else if (VM_FRAME_FINISHED_P(cfp)) {
@@ -307,20 +307,20 @@ rb_vmdebug_debug_print_register(rb_thread_t *th)
{
rb_control_frame_t *cfp = th->ec.cfp;
ptrdiff_t pc = -1;
- ptrdiff_t ep = cfp->ep - th->ec.stack;
+ ptrdiff_t ep = cfp->ep - th->ec.vm_stack;
ptrdiff_t cfpi;
if (VM_FRAME_RUBYFRAME_P(cfp)) {
pc = cfp->pc - cfp->iseq->body->iseq_encoded;
}
- if (ep < 0 || (size_t)ep > th->ec.stack_size) {
+ if (ep < 0 || (size_t)ep > th->ec.vm_stack_size) {
ep = -1;
}
- cfpi = ((rb_control_frame_t *)(th->ec.stack + th->ec.stack_size)) - cfp;
+ cfpi = ((rb_control_frame_t *)(th->ec.vm_stack + th->ec.vm_stack_size)) - cfp;
fprintf(stderr, " [PC] %04"PRIdPTRDIFF", [SP] %04"PRIdPTRDIFF", [EP] %04"PRIdPTRDIFF", [CFP] %04"PRIdPTRDIFF"\n",
- pc, (cfp->sp - th->ec.stack), ep, cfpi);
+ pc, (cfp->sp - th->ec.vm_stack), ep, cfpi);
}
void
@@ -342,7 +342,7 @@ rb_vmdebug_debug_print_pre(rb_thread_t *th, rb_control_frame_t *cfp, const VALUE
printf(" ");
}
printf("| ");
- if(0)printf("[%03ld] ", (long)(cfp->sp - th->ec.stack));
+ if(0)printf("[%03ld] ", (long)(cfp->sp - th->ec.vm_stack));
/* printf("%3"PRIdPTRDIFF" ", VM_CFP_CNT(th, cfp)); */
if (pc >= 0) {