[前][次][番号順一覧][スレッド一覧]

ruby-changes:48452

From: ko1 <ko1@a...>
Date: Mon, 30 Oct 2017 01:12:12 +0900 (JST)
Subject: [ruby-changes:48452] ko1:r60566 (trunk): * vm_dump.c (vm_stack_dump_each): accepts `ec`.

ko1	2017-10-30 01:12:06 +0900 (Mon, 30 Oct 2017)

  New Revision: 60566

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60566

  Log:
    * vm_dump.c (vm_stack_dump_each): accepts `ec`.
    
    * vm_dump.c (vm_base_ptr): constify.

  Modified files:
    trunk/vm_dump.c
Index: vm_dump.c
===================================================================
--- vm_dump.c	(revision 60565)
+++ vm_dump.c	(revision 60566)
@@ -220,9 +220,9 @@ rb_vmdebug_stack_dump_th(VALUE thval) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L220
 
 /* 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) https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L232
 }
 
 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_c https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L258
     {
 	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_c https://github.com/ruby/ruby/blob/trunk/vm_dump.c#L285
 		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(); */

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]