Hi,

At Sun, 21 Sep 2008 03:02:44 +0900,
Roger Pack wrote in [ruby-core:18762]:
> I wasn't sure how to patch 
> RubyVM::InstructionSequence.disassemble
> to work with proc objects AND methods, so added a new method
> RubyVM::InstructionSequence.disassemble_proc
> which works for proc objects, in the accompanying patch.
> Either way would work.

It's pretty easy.


Index: iseq.c =================================================================== --- iseq.c (revision 23974) +++ iseq.c (working copy) @@ -1007,4 +1007,13 @@ iseq_s_disasm(VALUE klass, VALUE body) } } + else { + rb_proc_t *proc; + VALUE iseqval; + GetProcPtr(body, proc); + iseqval = proc->block.iseq->self; + if (RUBY_VM_NORMAL_ISEQ_P(iseqval)) { + ret = rb_iseq_disasm(iseqval); + } + } return ret;
-- Nobu Nakada