summaryrefslogtreecommitdiff
path: root/error.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-13 05:25:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-11-13 05:25:53 +0000
commitd432839cbdefc792adce02f9ea759bb2bb3249fd (patch)
tree82191fc7d8d514e5dd42b4ccc08b8eeb6b21b992 /error.c
parent48d5a921abbed10b2f003a6c44a681357b179aa2 (diff)
downloadruby-d432839cbdefc792adce02f9ea759bb2bb3249fd.tar.gz
error.c: rb_get_backtrace
* error.c (rb_get_backtrace): move from eval_error.c to call exc_backtrace directly. [ruby-core:78097] [Bug #12925] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56766 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'error.c')
-rw-r--r--error.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/error.c b/error.c
index 0856bc0e2a..4503742896 100644
--- a/error.c
+++ b/error.c
@@ -882,6 +882,22 @@ exc_backtrace(VALUE exc)
return obj;
}
+VALUE
+rb_get_backtrace(VALUE exc)
+{
+ VALUE info, klass = rb_eException;
+ ID mid = id_backtrace;
+ rb_thread_t *th = GET_THREAD();
+ if (NIL_P(exc))
+ return Qnil;
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, exc, mid, mid, klass, Qundef);
+ info = exc_backtrace(exc);
+ EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, exc, mid, mid, klass, info);
+ if (NIL_P(info))
+ return Qnil;
+ return rb_check_backtrace(info);
+}
+
/*
* call-seq:
* exception.backtrace_locations -> array