From: Mark Moseley Date: 2009-08-09T01:29:46+09:00 Subject: [ruby-dev:39048] [Bug #1676] only last "return" is traced by set_trace_func チケット #1676 が更新されました。 (by Mark Moseley) Patch to fix this: --- compile.c (revision 24476) +++ compile.c (working copy) @@ -2959,6 +2959,8 @@ COMPILE_(ret, "BLOCK body", node->nd_head, (node->nd_next == 0 && poped == 0) ? 0 : 1); node = node->nd_next; + if (node) + iseq->compile_data->last_line = nd_line(node); } if (node) { COMPILE_(ret, "BLOCK next", node->nd_next, poped); This is probably not the best solution, though. It appears to me that there might be other problems lurking in iseq_compile_each() after any "node = node->nd_next" statement. I think that probably a macro that both goes to the next node, and resets the line number, (and maybe also resets type) is appropriate, but I haven't investigated this in depth. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/1676 ---------------------------------------- http://redmine.ruby-lang.org