@classmethod
def find_slot(cls, ctx):
    """
        Finds an empty slot to set a hardware breakpoint.

        @see: clear_bp, set_bp

        @type  ctx: dict( str S{->} int )
        @param ctx: Thread context dictionary.

        @rtype:  int
        @return: Slot (debug register) for hardware breakpoint.
        """
    Dr7 = ctx['Dr7']
    slot = 0
    for m in cls.enableMask:
        if Dr7 & m == 0:
            return slot
        slot += 1
    return None
