aboutsummaryrefslogtreecommitdiffstats
path: root/vm_backtrace.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 12:09:17 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-01 12:09:17 +0000
commitc906e879d8e83263752a25faf34cc102a7b2e60e (patch)
treeaed64622f12505c33d291b42f6077a2fb628d661 /vm_backtrace.c
parent01eb117b01576e5b8386af5b6b425655f314888c (diff)
downloadruby-c906e879d8e83263752a25faf34cc102a7b2e60e.tar.gz
* vm_backtrace.c (location_inspect_m): add
Thread::Backtrace::Location#inspect. It same as loc_obj.to_s.inspect. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_backtrace.c')
-rw-r--r--vm_backtrace.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/vm_backtrace.c b/vm_backtrace.c
index 9dcb76de1e..8e10d6eb73 100644
--- a/vm_backtrace.c
+++ b/vm_backtrace.c
@@ -300,6 +300,12 @@ location_to_str_m(VALUE self)
return location_to_str(location_ptr(self));
}
+static VALUE
+location_inspect_m(VALUE self)
+{
+ return rb_str_inspect(location_to_str(location_ptr(self)));
+}
+
typedef struct rb_backtrace_struct {
rb_backtrace_location_t *backtrace;
rb_backtrace_location_t *backtrace_base;
@@ -860,6 +866,7 @@ Init_vm_backtrace(void)
rb_define_method(rb_cBacktraceLocation, "path", location_path_m, 0);
rb_define_method(rb_cBacktraceLocation, "absolute_path", location_absolute_path_m, 0);
rb_define_method(rb_cBacktraceLocation, "to_s", location_to_str_m, 0);
+ rb_define_method(rb_cBacktraceLocation, "inspect", location_inspect_m, 0);
rb_define_global_function("caller", rb_f_caller, -1);
rb_define_global_function("caller_locations", rb_f_caller_locations, -1);