def walk_tb(tb):
    """Walk a traceback yielding the frame and line number for each frame.
    This will follow tb.tb_next (and thus is in the opposite order to
    walk_stack). Usually used with StackSummary.extract.
    """
    track = False
    result = []
    while tb is not None:
        if track:
            result.append((tb.tb_frame, tb.tb_lineno))
        if '__log_tb_start__' in tb.tb_frame.f_locals:
            result = []
            track = True
        tb = tb.tb_next
    return result