summaryrefslogtreecommitdiff
path: root/probes_helper.h
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 17:55:54 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 17:55:54 +0000
commit970944847455dae54072ade11b4f4247e4707681 (patch)
treed2f0a8f6abb5dab608b60426768b7c6886ee529c /probes_helper.h
parent4556a9ec654406c1be43a0b0b3bff99e4d0ed3c1 (diff)
* vm.c: add a return hook when a method raises an exception.
* probes_helper.h: look up klass and method if none are provided. * eval.c: update macro usage. * vm_eval.c: ditto. * vm_insnhelper.c: ditto. * test/dtrace/test_function_entry.rb: test for change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'probes_helper.h')
-rw-r--r--probes_helper.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/probes_helper.h b/probes_helper.h
index c8d8c9840b..7f4beb944f 100644
--- a/probes_helper.h
+++ b/probes_helper.h
@@ -18,11 +18,19 @@
} \
} \
-#define RUBY_DTRACE_METHOD_RETURN_HOOK(klass, id) \
+#define RUBY_DTRACE_METHOD_RETURN_HOOK(th, klass, id) \
if (RUBY_DTRACE_METHOD_RETURN_ENABLED()) { \
- const char * classname = rb_class2name((klass)); \
- const char * methodname = rb_id2name((id)); \
- const char * filename = rb_sourcefile(); \
+ VALUE _klass = (klass); \
+ VALUE _id = (id); \
+ const char * classname; \
+ const char * methodname; \
+ const char * filename; \
+ if (!_klass) { \
+ rb_thread_method_id_and_class((th), &_id, &_klass); \
+ } \
+ classname = rb_class2name(_klass); \
+ methodname = rb_id2name(_id); \
+ filename = rb_sourcefile(); \
if (classname && methodname && filename) { \
RUBY_DTRACE_METHOD_RETURN( \
classname, \