def METHOD_NAME(jmpbuf):
    '''Backtrace a jmpbuf'''
    regs = get_jmpbuf_regs(jmpbuf)
    old = dict()
    # remember current stack frame and select the topmost
    # so that register modifications don't wreck it
    selected_frame = gdb.selected_frame()
    gdb.newest_frame().select()
    for i in regs:
        old[i] = gdb.parse_and_eval('(uint64_t)$%s' % i)
    for i in regs:
        gdb.execute('set $%s = %s' % (i, regs[i]))
    gdb.execute('bt')
    for i in regs:
        gdb.execute('set $%s = %s' % (i, old[i]))
    selected_frame.select()