class DEBUGGER__::Session

def method_added tp

def method_added tp
  b = tp.binding
  if var_name = b.local_variables.first
    mid = b.local_variable_get(var_name)
    resolved = true
    @bps.each{|k, bp|
      case bp
      when MethodBreakpoint
        if bp.method.nil?
          if bp.sig_method_name == mid.to_s
            bp.try_enable(added: true)
          end
        end
        resolved = false if !bp.enabled?
      end
    }
    if resolved
      Session.deactivate_method_added_trackers
    end
    case mid
    when :method_added, :singleton_method_added
      Session.create_method_added_tracker(tp.self, mid)
      Session.activate_method_added_trackers unless resolved
    end
  end
end