summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-14 05:59:23 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-06-14 05:59:23 +0000
commit63bd8a74e81537ecf2aba0be0f8ef6eec9df2758 (patch)
tree438b47a99a569e357944ccbf0cc072b3213cad18 /thread.c
parentd3027870eeebed365979875858159d98e0f1effa (diff)
* 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
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c9
1 files changed, 9 insertions, 0 deletions
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);