Project

General

Profile

Actions

Feature #7435

closed

Exceptions should have backtrace_locations

Added by sam.saffron (Sam Saffron) almost 12 years ago. Updated over 11 years ago.

Status:
Rejected
Target version:
[ruby-core:50093]

Description

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.

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0