diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-03 15:11:53 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-09-03 15:11:53 +0000 |
commit | bc2a1f2a98b04f040ea485cedd3283f2f3906e4c (patch) | |
tree | 833ab2f599dfd7576201ab5745e7ffeb5436fd88 /vm.c | |
parent | 3e0819c66a0908be61fbb769e96c1accb1d67f26 (diff) | |
download | ruby-bc2a1f2a98b04f040ea485cedd3283f2f3906e4c.tar.gz |
* variable.c (rb_const_set): show the previous definition
location. [EXPERIMENTAL]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33175 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -829,6 +829,20 @@ vm_backtrace(rb_thread_t *th, int lev) return rb_ary_reverse(ary); } +VALUE +rb_sourcefilename(void) +{ + rb_thread_t *th = GET_THREAD(); + rb_control_frame_t *cfp = rb_vm_get_ruby_level_next_cfp(th, th->cfp); + + if (cfp) { + return cfp->iseq->filename; + } + else { + return Qnil; + } +} + const char * rb_sourcefile(void) { |