summaryrefslogtreecommitdiff
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 20:30:01 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-28 20:30:01 +0000
commit2fa079b62ac3611ee7c52c605bd2da8209129895 (patch)
treeb5a258e8931d8b43c4625e11010a548e1bea1c3d /vm_backtrace.c
parent4bdd9095183666d515635946085becc66a418b16 (diff)
* vm_backtrace.c (backtrace_to_str_ary2): rename to backtrace_to_str_ary.
* vm_backtrace.c (rb_backtrace_to_str_ary): use `backtrace_to_str_ary()'. * vm_backtrace.c (backtrace_to_frame_ary): rename to backtrace_to_location_ary. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 0f798e1..143552b 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -490,23 +490,8 @@ location_to_str_dmyarg(rb_backtrace_location_t *loc, void *dmy)
return location_to_str(loc);
}
-VALUE
-rb_backtrace_to_str_ary(VALUE self)
-{
- rb_backtrace_t *bt;
- GetCoreDataFromValue(self, rb_backtrace_t, bt);
-
- if (bt->strary) {
- return bt->strary;
- }
- else {
- bt->strary = backtrace_collect(bt, 0, bt->backtrace_size, location_to_str_dmyarg, 0);
- return bt->strary;
- }
-}
-
static VALUE
-backtrace_to_str_ary2(VALUE self, int lev, int n)
+backtrace_to_str_ary(VALUE self, int lev, int n)
{
rb_backtrace_t *bt;
int size;
@@ -523,6 +508,18 @@ backtrace_to_str_ary2(VALUE self, int lev, int n)
return backtrace_collect(bt, lev, n, location_to_str_dmyarg, 0);
}
+VALUE
+rb_backtrace_to_str_ary(VALUE self)
+{
+ rb_backtrace_t *bt;
+ GetCoreDataFromValue(self, rb_backtrace_t, bt);
+
+ if (!bt->strary) {
+ bt->strary = backtrace_to_str_ary(self, 0, bt->backtrace_size);
+ }
+ return bt->strary;
+}
+
static VALUE
location_create(rb_backtrace_location_t *srcloc, void *btobj)
{
@@ -537,7 +534,7 @@ location_create(rb_backtrace_location_t *srcloc, void *btobj)
}
static VALUE
-backtrace_to_frame_ary(VALUE self, int lev, int n)
+backtrace_to_location_ary(VALUE self, int lev, int n)
{
rb_backtrace_t *bt;
int size;
@@ -573,13 +570,13 @@ backtrace_load_data(VALUE self, VALUE str)
VALUE
vm_backtrace_str_ary(rb_thread_t *th, int lev, int n)
{
- return backtrace_to_str_ary2(backtrace_object(th), lev, n);
+ return backtrace_to_str_ary(backtrace_object(th), lev, n);
}
VALUE
-vm_backtrace_frame_ary(rb_thread_t *th, int lev, int n)
+vm_backtrace_location_ary(rb_thread_t *th, int lev, int n)
{
- return backtrace_to_frame_ary(backtrace_object(th), lev, n);
+ return backtrace_to_location_ary(backtrace_object(th), lev, n);
}
/* make old style backtrace directly */
@@ -728,7 +725,7 @@ vm_backtrace_to_ary(rb_thread_t *th, int argc, VALUE *argv, int lev_default, int
return vm_backtrace_str_ary(th, lev+lev_plus, n);
}
else {
- return vm_backtrace_frame_ary(th, lev+lev_plus, n);
+ return vm_backtrace_location_ary(th, lev+lev_plus, n);
}
}