class DEBUGGER__::ThreadClient::Recorder

def initialize

def initialize
  @log = []
  @index = 0
  @backup_frames = nil
  thread = Thread.current
  @tp_recorder ||= TracePoint.new(:line){|tp|
    next unless Thread.current == thread
    # can't be replaced by skip_location
    next if skip_internal_path?(tp.path)
    loc = caller_locations(1, 1).first
    next if skip_location?(loc)
    frames = DEBUGGER__.capture_frames(__dir__)
    frames.each{|frame|
      if b = frame.binding
        frame.binding = nil
        frame._local_variables = b.local_variables.map{|name|
          [name, b.local_variable_get(name)]
        }.to_h
        frame._callee = b.eval('__callee__')
      end
    }
    append(frames)
  }
end