summaryrefslogtreecommitdiff
path: root/vm_dump.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 16:12:06 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-29 16:12:06 +0000
commitd51de2bd61a60a0fae647605f1b362dc82f12321 (patch)
treec7cb03261035c03819c3d9b53899d9aa08b29159 /vm_dump.c
parent85fcaf025defe5f84880d111663218aa42d0d158 (diff)
downloadruby-d51de2bd61a60a0fae647605f1b362dc82f12321.tar.gz
* vm_dump.c (vm_stack_dump_each): accepts `ec`.
* vm_dump.c (vm_base_ptr): constify. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60566 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_dump.c')
-rw-r--r--vm_dump.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/vm_dump.c b/vm_dump.c
index ff27d7c0a9..fd13cfceb1 100644
--- a/vm_dump.c
+++ b/vm_dump.c
@@ -220,9 +220,9 @@ rb_vmdebug_stack_dump_th(VALUE thval)
/* copy from vm.c */
static const VALUE *
-vm_base_ptr(rb_control_frame_t *cfp)
+vm_base_ptr(const rb_control_frame_t *cfp)
{
- rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
+ const rb_control_frame_t *prev_cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
const VALUE *bp = prev_cfp->sp + cfp->iseq->body->local_table_size + VM_ENV_DATA_SIZE;
if (cfp->iseq->body->type == ISEQ_TYPE_METHOD) {
@@ -232,7 +232,7 @@ vm_base_ptr(rb_control_frame_t *cfp)
}
static void
-vm_stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp)
+vm_stack_dump_each(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
{
int i, argc = 0, local_table_size = 0;
VALUE rstr;
@@ -258,7 +258,7 @@ vm_stack_dump_each(rb_thread_t *th, rb_control_frame_t *cfp)
{
const VALUE *ptr = ep - local_table_size;
- control_frame_dump(th, cfp);
+ control_frame_dump(ec, cfp);
for (i = 0; i < argc; i++) {
rstr = rb_inspect(*ptr);
@@ -285,12 +285,12 @@ 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->vm_stack));
+ (ptr - ec->vm_stack));
}
}
else if (VM_FRAME_FINISHED_P(cfp)) {
- if ((th)->ec->vm_stack + (th)->ec->vm_stack_size > (VALUE *)(cfp + 1)) {
- vm_stack_dump_each(th, cfp + 1);
+ if (ec->vm_stack + ec->vm_stack_size > (VALUE *)(cfp + 1)) {
+ vm_stack_dump_each(ec, cfp + 1);
}
else {
/* SDR(); */