summaryrefslogtreecommitdiff
path: root/proc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-30 06:36:11 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-30 06:36:11 (GMT)
commit66296d37745c42cf12e056a0c78a7831c4989c78 (patch)
treec755f4541a74506771ba52100baebc58e39b0748 /proc.c
parentc2310baf9aa8debf6849f4dcec769d008d30b5a5 (diff)
proc.c: include symbol name
* proc.c (proc_to_s): include the original symbol name in string form. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51988 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'proc.c')
-rw-r--r--proc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/proc.c b/proc.c
index f01d404..98029d0 100644
--- a/proc.c
+++ b/proc.c
@@ -1059,6 +1059,7 @@ proc_to_s(VALUE self)
const char *cname = rb_obj_classname(self);
const rb_iseq_t *iseq;
const char *is_lambda;
+ const struct vm_ifunc *ifunc;
GetProcPtr(self, proc);
iseq = proc->block.iseq;
@@ -1073,6 +1074,10 @@ proc_to_s(VALUE self)
str = rb_sprintf("#<%s:%p@%"PRIsVALUE":%d%s>", cname, (void *)self,
iseq->body->location.path, first_lineno, is_lambda);
}
+ else if ((ifunc = (struct vm_ifunc *)iseq)->func == rb_sym_proc_call) {
+ str = rb_sprintf("#<%s:%p(&%+"PRIsVALUE")%s>", cname, (void *)self,
+ ID2SYM((ID)ifunc->data), is_lambda);
+ }
else {
str = rb_sprintf("#<%s:%p%s>", cname, (void *)proc->block.iseq,
is_lambda);