* [Bug #22197] Backtraces show methods which do not exist (eregon) * As the title says, backtraces sometimes list methods which do not exist, because of mixing definition name with run-time owner (`Method#owner`). * Since we print fi...Eregon (Benoit Daloze)
* [Feature #22212] Add Thread::Backtrace::Location#source_range (eregon) * Proposes a portable API returning a `Ruby::SourceRange` for an exception's `backtrace_locations` or for `caller_locations`. * This gives tools stable start/...Eregon (Benoit Daloze)
I guess one concrete issue here with using `rb_str_new_static()` is the mmaped file/stack buffer will be freed soon after the `RubyVM::InstructionSequence.load_from_binary(String)` call, but that String object might live longer, there is...Eregon (Benoit Daloze)
> in each Proc or binding A small precision here which might be helpful is svars are only stored on method frames, never on block frames. So it's per method frame and Proc are unaffected (they just access the encapsulating method fram...Eregon (Benoit Daloze)
To give a bit more details, TruffleRuby then always reserves one slot in the frame for svar's, and lazily allocate the storage for them on first access: https://github.com/truffleruby/truffleruby/blob/33598a0447c4cd0b56eb56b80e81b094ea5...Eregon (Benoit Daloze)
TruffleRuby already make these always thread-local, and there has been 0 compatibility issue reported about that. It's basically option (1) mentioned by @ko1, i.e. a dictionary/ThreadLocal object on the frame, but with the optimization ...Eregon (Benoit Daloze)
ko1 (Koichi Sasada) wrote in #note-14: > Just to confirm: the PR's implementation of `Thread::Backtrace::Location#source_range` seems fragile because it reparses the script from the file system. > ... Yes, this is intentional to avoid ...Eregon (Benoit Daloze)
Ah one more thing I wanted to mention is it might still be possible to support Ruby 2.7 in gems without `ruby2_keywords` by using `def foo(...); bar(...); end` which was introduced in Ruby 2.7.2 (although that does not cover all delegati...Eregon (Benoit Daloze)
Big +1 from me, and agreed it's definitely worth deprecating them but also there is no immediate need so the proposed schedule sounds good to me. The main thing I'm interested to remove is the special dispatch on `foo(*args)` when `ar...Eregon (Benoit Daloze)
Because that reply is long I'll also make a concise reply regarding use cases: This API is useful to any tool or gem that needs to locate or extract the source code associated with an exception's `backtrace_locations` (or `caller_loca...Eregon (Benoit Daloze)