summaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-03 15:11:53 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-09-03 15:11:53 +0000
commitbc2a1f2a98b04f040ea485cedd3283f2f3906e4c (patch)
tree833ab2f599dfd7576201ab5745e7ffeb5436fd88 /vm.c
parent3e0819c66a0908be61fbb769e96c1accb1d67f26 (diff)
downloadruby-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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/vm.c b/vm.c
index 80b0857de5..d57f62b516 100644
--- a/vm.c
+++ b/vm.c
@@ -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)
{