def main(timeout):
    run_time = time.time()
    log.debug("timeout: %0.2fs", timeout)
    log.debug("collect initial trace")
    set_thread(get_hung_thread())
    log.debug("init complete")

    addrs = get_addr_list()
    while len(addrs) > 1:
        log.debug("stack length: %d", len(addrs))
        if not find_next_sym(addrs[1], addrs[0], timeout) and not is_complete():
            log.debug("trace complete")
            break
        if get_proc_run_time() >= timeout:
            log.debug("trace timeout hit")
            break
        addrs.pop(0)
        if is_complete():
            log.info("target process has exited")
            addrs = list()

    log.info("*" * 60)
    if addrs:
        for line in filter_noise(get_current_stack()):
            log.info("STACK_FRAME:%s", line)
    else:
        log.info("Not a timeout!")
    log.info("*" * 60)
    log.info("----- STATS -----")
    log.info("DGB TIME: %0.2f", time.time()-run_time)
    log.info("PROC TIME: %0.2f", get_proc_run_time())
    log.info("THREAD TIME: %0.2f", get_thread_run_time(get_thread_list()[get_hung_thread()]))
dataset/ETHPy150Open blackberry/ALF/lib/dbgmin/scripts/WinDBGTrace.py/main/original