summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 10:57:16 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-26 10:57:16 (GMT)
commit24044b2f6311f4cef41e7509018823c2dfd26577 (patch)
treebbd960638bc32d42a5480f45cefd9885a6057825 /vm_backtrace.c
parent284d4c08d66d15b299c9b483a80131d73a617af4 (diff)
backtrace_each() accepts `ec` instead of `th`.
* vm_backtrace.c (backtrace_each): accepts `ec` instead of `th`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 8b1d53a..74c877a 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -421,14 +421,14 @@ backtrace_alloc(VALUE klass)
}
static void
-backtrace_each(rb_thread_t *th,
+backtrace_each(const rb_execution_context_t *ec,
void (*init)(void *arg, size_t size),
void (*iter_iseq)(void *arg, const rb_control_frame_t *cfp),
void (*iter_cfunc)(void *arg, const rb_control_frame_t *cfp, ID mid),
void *arg)
{
- const rb_control_frame_t *last_cfp = th->ec->cfp;
- const rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(th->ec);
+ const rb_control_frame_t *last_cfp = ec->cfp;
+ const rb_control_frame_t *start_cfp = RUBY_VM_END_CONTROL_FRAME(ec);
const rb_control_frame_t *cfp;
ptrdiff_t size, i;
@@ -439,7 +439,7 @@ backtrace_each(rb_thread_t *th,
* top frame
* ...
* 2nd frame <- lev:0
- * current frame <- th->ec->cfp
+ * current frame <- ec->cfp
*/
start_cfp =
@@ -457,7 +457,7 @@ backtrace_each(rb_thread_t *th,
/* SDR(); */
for (i=0, cfp = start_cfp; i<size; i++, cfp = RUBY_VM_NEXT_CONTROL_FRAME(cfp)) {
- /* fprintf(stderr, "cfp: %d\n", (rb_control_frame_t *)(th->stack + th->stack_size) - cfp); */
+ /* fprintf(stderr, "cfp: %d\n", (rb_control_frame_t *)(ec->vm_stack + ec->vm_stack_size) - cfp); */
if (cfp->iseq) {
if (cfp->pc) {
iter_iseq(arg, cfp);
@@ -517,7 +517,7 @@ rb_threadptr_backtrace_object(rb_thread_t *th)
struct bt_iter_arg arg;
arg.prev_loc = 0;
- backtrace_each(th,
+ backtrace_each(th->ec,
bt_init,
bt_iter_iseq,
bt_iter_cfunc,
@@ -726,7 +726,7 @@ vm_backtrace_print(FILE *fp)
arg.func = oldbt_print;
arg.data = (void *)fp;
- backtrace_each(GET_THREAD(),
+ backtrace_each(GET_EC(),
oldbt_init,
oldbt_iter_iseq,
oldbt_iter_cfunc,
@@ -759,7 +759,7 @@ rb_backtrace_print_as_bugreport(void)
arg.func = oldbt_bugreport;
arg.data = (int *)&i;
- backtrace_each(GET_THREAD(),
+ backtrace_each(GET_EC(),
oldbt_init,
oldbt_iter_iseq,
oldbt_iter_cfunc,
@@ -802,7 +802,7 @@ rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output)
parg.output = output;
arg.func = oldbt_print_to;
arg.data = &parg;
- backtrace_each(GET_THREAD(),
+ backtrace_each(GET_EC(),
oldbt_init,
oldbt_iter_iseq,
oldbt_iter_cfunc,
@@ -1141,7 +1141,7 @@ collect_caller_bindings(rb_thread_t *th)
data.ary = rb_ary_new();
- backtrace_each(th,
+ backtrace_each(th->ec,
collect_caller_bindings_init,
collect_caller_bindings_iseq,
collect_caller_bindings_cfunc,