1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Disasm output contains code range.

* iseq.c (iseq_inspect): show also code range information.
  Note that `iseq_inspect` is used only for header of disasm.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61463 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-12-25 04:40:42 +00:00
parent 05d4ee8630
commit d7c6776f7c

8
iseq.c
View file

@ -1658,9 +1658,13 @@ iseq_inspect(const rb_iseq_t *iseq)
return rb_sprintf("#<ISeq: uninitialized>");
}
else {
return rb_sprintf("#<ISeq:%s@%s:%d>",
return rb_sprintf("#<ISeq:%s@%s:%d (%d,%d)-(%d,%d)>",
RSTRING_PTR(iseq->body->location.label), RSTRING_PTR(rb_iseq_path(iseq)),
FIX2INT(rb_iseq_first_lineno(iseq)));
iseq->body->location.code_range.first_loc.lineno,
iseq->body->location.code_range.first_loc.lineno,
iseq->body->location.code_range.first_loc.column,
iseq->body->location.code_range.last_loc.lineno,
iseq->body->location.code_range.last_loc.column);
}
}