Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ch1c0t/ba925c3f9cd6f08cdea026c843ab4b7e to your computer and use it in GitHub Desktop.
Save ch1c0t/ba925c3f9cd6f08cdea026c843ab4b7e to your computer and use it in GitHub Desktop.
TRACE_POINTS = []
TRACE = TracePoint.new :return, :c_return do |t|
TRACE_POINTS << [t.event, t.path, t.lineno, t.binding, t.defined_class, t.method_id, t.return_value]
end
def Trace
TRACE_POINTS.clear
TRACE.enable
yield
TRACE.disable
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment