diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-08 12:08:20 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-10-08 12:08:20 +0000 |
commit | cff2b2b66626e5aee5598f98b1f855249ca2f282 (patch) | |
tree | d2eac53c4065e0ddc4dc7c135eb512b1d47c0a25 /iseq.c | |
parent | 377758fdcba8c3655da6fd45808a69ac3c4bab82 (diff) | |
download | ruby-cff2b2b66626e5aee5598f98b1f855249ca2f282.tar.gz |
* vm_backtrace.c, include/ruby/debug.h: add new APIs
* VALUE rb_profile_frame_method_name(VALUE frame)
* VALUE rb_profile_frame_qualified_method_name(VALUE frame)
* iseq.c (rb_iseq_klass), internal.h: add new internal function
rb_iseq_method_name().
* ext/-test-/debug/profile_frames.c (profile_frames),
test/-ext-/debug/test_profile_frames.rb: add a test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -959,6 +959,20 @@ rb_iseq_klass(VALUE self) return iseq->local_iseq->klass; } +VALUE +rb_iseq_method_name(VALUE self) +{ + rb_iseq_t *iseq, *local_iseq; + GetISeqPtr(self, iseq); + local_iseq = iseq->local_iseq; + if (local_iseq->type == ISEQ_TYPE_METHOD) { + return local_iseq->location.base_label; + } + else { + return Qnil; + } +} + static VALUE iseq_data_to_ary(rb_iseq_t *iseq); |