rb-trace adds a trace_hook object, translates hooks bitmasks to Ruby sets and vice versa, and extends set_trace_func() to allow ignore specified frames or functions.

See this for a cool non-debugger use of this.