From 63bd8a74e81537ecf2aba0be0f8ef6eec9df2758 Mon Sep 17 00:00:00 2001 From: ko1 Date: Sun, 14 Jun 2009 05:59:23 +0000 Subject: * thread.c, vm_eval.c: add Thread.backtrace. * test/ruby/test_thread.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- thread.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'thread.c') diff --git a/thread.c b/thread.c index 573ace640c..efe5d02dd5 100644 --- a/thread.c +++ b/thread.c @@ -3817,6 +3817,14 @@ ruby_suppress_tracing(VALUE (*func)(VALUE, int), VALUE arg, int always) return result; } +VALUE rb_thread_backtrace(VALUE thval); + +static VALUE +rb_thread_backtrace_m(VALUE thval) +{ + return rb_thread_backtrace(thval); +} + /* * +Thread+ encapsulates the behavior of a thread of * execution, including the main thread of the Ruby script. @@ -3873,6 +3881,7 @@ Init_Thread(void) rb_define_method(rb_cThread, "abort_on_exception=", rb_thread_abort_exc_set, 1); rb_define_method(rb_cThread, "safe_level", rb_thread_safe_level, 0); rb_define_method(rb_cThread, "group", rb_thread_group, 0); + rb_define_method(rb_cThread, "backtrace", rb_thread_backtrace_m, 0); rb_define_method(rb_cThread, "inspect", rb_thread_inspect, 0); -- cgit v1.2.3