Make it possible to get AST::Node from Thread::Backtrace::Location

RubyVM::AST.of(Thread::Backtrace::Location) returns a node that
corresponds to the location. Typically, the node is a method call, but
not always.

This change also includes iseq's dump/load support of node_ids for each
instructions.
This commit is contained in:
Yusuke Endoh 2021-06-08 17:34:08 +09:00
parent ea6062898a
commit dfba87cd62
Notes: git 2021-06-18 03:35:59 +09:00
5 changed files with 107 additions and 21 deletions

View file

@ -111,6 +111,8 @@ int rb_backtrace_p(VALUE obj);
VALUE rb_backtrace_to_str_ary(VALUE obj);
VALUE rb_backtrace_to_location_ary(VALUE obj);
void rb_backtrace_each(VALUE (*iter)(VALUE recv, VALUE str), VALUE output);
int rb_frame_info_p(VALUE obj);
void rb_frame_info_get(VALUE obj, VALUE *path, int *node_id);
MJIT_SYMBOL_EXPORT_BEGIN
VALUE rb_ec_backtrace_object(const struct rb_execution_context_struct *ec);