summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-28 13:22:04 (GMT)
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-28 13:22:04 (GMT)
commitad1b64d35d7ca980a0398f09cff527d7420cd5c1 (patch)
tree8feddbfa970ca8663d196e050013800b8ff4030f /vm_backtrace.c
parent7fa4beba91d37a91dbacb5faa5e12202202ba2d8 (diff)
`th` -> `ec` for backtrace functions.
* vm_backtrace.c: accept `ec` and rename `threadptr` to `ec`. * rb_threadptr_backtrace_object -> rb_ec_backtrace_object * rb_threadptr_backtrace_str_ary -> rb_ec_backtrace_str_ar * rb_threadptr_backtrace_location_ary -> rb_ec_backtrace_location_ary * threadptr_backtrace_to_ary -> ec_backtrace_to_ary * vm_eval.c (adjust_backtrace_in_eval): accepts `ec`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index bc90267..a0815f1 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -512,12 +512,12 @@ bt_iter_cfunc(void *ptr, const rb_control_frame_t *cfp, ID mid)
}
VALUE
-rb_threadptr_backtrace_object(rb_thread_t *th)
+rb_ec_backtrace_object(const rb_execution_context_t *ec)
{
struct bt_iter_arg arg;
arg.prev_loc = 0;
- backtrace_each(th->ec,
+ backtrace_each(ec,
bt_init,
bt_iter_iseq,
bt_iter_cfunc,
@@ -650,15 +650,15 @@ backtrace_load_data(VALUE self, VALUE str)
}
VALUE
-rb_threadptr_backtrace_str_ary(rb_thread_t *th, long lev, long n)
+rb_ec_backtrace_str_ary(const rb_execution_context_t *ec, long lev, long n)
{
- return backtrace_to_str_ary(rb_threadptr_backtrace_object(th), lev, n);
+ return backtrace_to_str_ary(rb_ec_backtrace_object(ec), lev, n);
}
VALUE
-rb_threadptr_backtrace_location_ary(rb_thread_t *th, long lev, long n)
+rb_ec_backtrace_location_ary(const rb_execution_context_t *ec, long lev, long n)
{
- return backtrace_to_location_ary(rb_threadptr_backtrace_object(th), lev, n);
+ return backtrace_to_location_ary(rb_ec_backtrace_object(ec), lev, n);
}
/* make old style backtrace directly */
@@ -812,15 +812,15 @@ rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output)
VALUE
rb_make_backtrace(void)
{
- return rb_threadptr_backtrace_str_ary(GET_THREAD(), 0, 0);
+ return rb_ec_backtrace_str_ary(GET_EC(), 0, 0);
}
static VALUE
-threadptr_backtrace_to_ary(rb_thread_t *th, int argc, const VALUE *argv, int lev_default, int lev_plus, int to_str)
+ec_backtrace_to_ary(const rb_execution_context_t *ec, int argc, const VALUE *argv, int lev_default, int lev_plus, int to_str)
{
VALUE level, vn;
long lev, n;
- VALUE btval = rb_threadptr_backtrace_object(th);
+ VALUE btval = rb_ec_backtrace_object(ec);
VALUE r;
rb_backtrace_t *bt;
@@ -894,7 +894,7 @@ thread_backtrace_to_ary(int argc, const VALUE *argv, VALUE thval, int to_str)
if (target_th->to_kill || target_th->status == THREAD_KILLED)
return Qnil;
- return threadptr_backtrace_to_ary(target_th, argc, argv, 0, 0, to_str);
+ return ec_backtrace_to_ary(target_th->ec, argc, argv, 0, 0, to_str);
}
VALUE
@@ -950,7 +950,7 @@ rb_vm_thread_backtrace_locations(int argc, const VALUE *argv, VALUE thval)
static VALUE
rb_f_caller(int argc, VALUE *argv)
{
- return threadptr_backtrace_to_ary(GET_THREAD(), argc, argv, 1, 1, 1);
+ return ec_backtrace_to_ary(GET_EC(), argc, argv, 1, 1, 1);
}
/*
@@ -978,7 +978,7 @@ rb_f_caller(int argc, VALUE *argv)
static VALUE
rb_f_caller_locations(int argc, VALUE *argv)
{
- return threadptr_backtrace_to_ary(GET_THREAD(), argc, argv, 1, 1, 0);
+ return ec_backtrace_to_ary(GET_EC(), argc, argv, 1, 1, 0);
}
/* called from Init_vm() in vm.c */
@@ -1178,7 +1178,7 @@ rb_debug_inspector_open(rb_debug_inspector_func_t func, void *data)
dbg_context.th = th;
dbg_context.cfp = dbg_context.th->ec->cfp;
- dbg_context.backtrace = rb_threadptr_backtrace_location_ary(th, 0, 0);
+ dbg_context.backtrace = rb_ec_backtrace_location_ary(th->ec, 0, 0);
dbg_context.backtrace_size = RARRAY_LEN(dbg_context.backtrace);
dbg_context.contexts = collect_caller_bindings(th);