'Bypass a function by ignoring its execution (eg sleep/alarm)
Usage:
MYNAME function
MYNAME function del (re-active)'

def deactive(self, *arg):

    (function, action) = normalize_argv(arg, 2)
    if (function is None):
        self._missing_argument()
    if to_int(function):
        function = ('0x%x' % function)
    bnum = ('$deactive_%s_bnum' % function)
    if (action and ('del' in action)):
        peda.execute(('delete    %s' % bnum))
        peda.execute(('set    %s    =    "void"' % bnum))
        msg(("'%s'    re-activated" % function))
        return
    if ('void' not in peda.execute_redirect(('p    %s' % bnum))):
        out = peda.execute_redirect(('info    breakpoints    %s' % bnum))
        if out:
            msg(("Already    deactivated    '%s'" % function))
            msg(out)
            return
        else:
            peda.execute(('set    %s    =    "void"' % bnum))
    (arch, bits) = peda.getarch()
    if (not function.startswith('0x')):
        symbol = peda.elfsymbol(function)
        if (not symbol):
            warning_msg(("cannot    retrieve    info    of    function    '%s'" % function))
            return
        peda.execute(('break    *0x%x' % symbol[(function + '@plt')]))
    else:
        peda.execute(('break    *%s' % function))
    peda.execute(('set    %s    =    $bpnum' % bnum))
    tmpfd = tmpfile()
    if ('i386' in arch):
        tmpfd.write('\n'.join(['commands    $bpnum', 'silent', 'set    $eax    =    0', 'return', 'continue', 'end']))
    if ('64' in arch):
        tmpfd.write('\n'.join(['commands    $bpnum', 'silent', 'set    $rax    =    0', 'return', 'continue', 'end']))
    tmpfd.flush()
    peda.execute(('source    %s' % tmpfd.name))
    tmpfd.close()
    out = peda.execute_redirect(('info    breakpoints    %s' % bnum))
    if out:
        msg(("'%s'    deactivated" % function))
        msg(out)
    return
