From: "ko1 (Koichi Sasada)" Date: 2012-12-03T20:56:01+09:00 Subject: [ruby-core:50521] [ruby-trunk - Feature #7435] Exceptions should have backtrace_locations Issue #7435 has been updated by ko1 (Koichi Sasada). One more comment. Exception class has Exception#set_backtrace method, which set backtrace using string array. It conflicts with locations. We need to solve this issue to support Exception#backtrace_locations. ---------------------------------------- Feature #7435: Exceptions should have backtrace_locations https://bugs.ruby-lang.org/issues/7435#change-34359 Author: sam.saffron (Sam Saffron) Status: Rejected Priority: Normal Assignee: ko1 (Koichi Sasada) Category: core Target version: next minor Further to http://bugs.ruby-lang.org/issues/7051 def boom raise "boom" end begin boom rescue => e p e.backtrace end # ["t.rb:2:in `boom'", "t.rb:6:in `
'"] It seems exceptions still store backtraces in strings, shouldn't the backtrace be stored in RubyVM::Backtrace::Location objects and then optionally grabbed using backtrace_locations or backtrace depending on how you feel? This means exceptions could be more efficient as filenames could easily be pinned in memory leading to significantly reduced allocation for exceptions. -- http://bugs.ruby-lang.org/