Thank you for your help Christian.
Would there be a way to access the Node struct from a Ruby object?
My objective is to find all of the file and line numbers of the class,
module, and method definitions.
To me, it looks like it would require significant rewriting of the Ruby
to easily achieve this.
The reason is I’m looking at
#define NEW_METHOD(n,x) NEW_NODE(NODE_METHOD,x,n,0)
#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS
#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0)
They are all called in parse.y, parse.c, class.c, and eval.c
It looks like set_trace_func is the best way to achieve this goal.