When I use set_trace_func to trace ruby code, I get a wrong binding in
case of c-calls. In this case binding.eval("self") is not the receiver
of the call. Whereas in case of ruby-calls binding.eval("self") yields
the receiver of the call.
The underlying problem is that c-calls aren't pushed onto the frame stack.
It seems that currently there is no way to find out the receiver of c-call
inside tracing function.

Seems like the new way to get the receiver is the (({#self})) instance method of the (({TracePoint})) class. However, the documentation states "(({Same as #binding: trace.binding.eval('self')}))", so that should probably be corrected or further explained.

Regarding c-frames not being pushed onto the frame stack, they actually are, but after the Tracepoint/set_trace_func event. I made the same mistake here: #8538. Have a look at source:vm_insnhelper.c#L1514 and observe how (({vm_push_frame})) is called after (({EXEC_EVENT_HOOK})).

I still think the behaviour should be consistent and when inside a TracePoint event the current frame should either be already in the backtrace or not, but not behave differently for c methods and ruby methods.