1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2012-12-01 12:09:17 +00:00
parent 01eb117b01
commit c906e879d8
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,9 @@
Sat Dec 1 21:06:58 2012 Koichi Sasada <ko1@atdot.net>
* vm_backtrace.c (location_inspect_m): add
Thread::Backtrace::Location#inspect.
It same as loc_obj.to_s.inspect.
Sat Dec 1 19:24:09 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_io_puts): recurse for the argument itself, not converted

View file

@ -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);