Meet trip, a concurrent tracer built on set_trace_func & implemented in pure Ruby.
trip.rb is a concurrent tracer that can pause, resume and alter code while it is being traced. The tracer yields control between two threads, typically the main thread and a thread that Trip creates. Under the hood, Trip uses
Thread#set_trace_func. It could be used to implement a debugger.