當前位置: 首頁>>代碼示例>>Python>>正文


Python ipdb.launch_ipdb_on_exception方法代碼示例

本文整理匯總了Python中ipdb.launch_ipdb_on_exception方法的典型用法代碼示例。如果您正苦於以下問題:Python ipdb.launch_ipdb_on_exception方法的具體用法?Python ipdb.launch_ipdb_on_exception怎麽用?Python ipdb.launch_ipdb_on_exception使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ipdb的用法示例。


在下文中一共展示了ipdb.launch_ipdb_on_exception方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: run_in_ipdb

# 需要導入模塊: import ipdb [as 別名]
# 或者: from ipdb import launch_ipdb_on_exception [as 別名]
def run_in_ipdb(func, args):
    import ipdb
    with ipdb.launch_ipdb_on_exception():
        func(args) 
開發者ID:fabiencro,項目名稱:knmt,代碼行數:6,代碼來源:__main__.py

示例2: main

# 需要導入模塊: import ipdb [as 別名]
# 或者: from ipdb import launch_ipdb_on_exception [as 別名]
def main(argv: List[str] = sys.argv) -> Any:
    args = parse_arguments(argv)
    if args.debug:
        from ipdb import launch_ipdb_on_exception

        with launch_ipdb_on_exception():
            return args.func(args)
    return args.func(args) 
開發者ID:hase-project,項目名稱:hase,代碼行數:10,代碼來源:__init__.py

示例3: build_cfg

# 需要導入模塊: import ipdb [as 別名]
# 或者: from ipdb import launch_ipdb_on_exception [as 別名]
def build_cfg(instructions: List[Instruction], loader: Loader) -> CFG:
    """
    Check that calls matches returns and that syscalls and non-jumps do not change the control flow.
    """
    stack = []  # type: List[int]
    builder = CfgBuilder(instructions)
    for (i, instruction) in enumerate(instructions):
        if i > 0:
            previous = instructions[i - 1]
            if (
                previous.iclass in BLOCK_TERMINATORS
                or previous.ip + previous.size != instruction.ip
            ):
                builder.add_edge(previous, instruction)

            if previous.iclass == InstructionClass.ptic_return:
                if len(stack) != 0:
                    return_ip = stack.pop()
                    if return_ip != instruction.ip:
                        previous_loc = loader.find_location(instructions[i - 1].ip)
                        instruction_loc = loader.find_location(instruction.ip)
                        return_loc = loader.find_location(return_ip)
                        l.warning(
                            "unexpected call return {} from {} found: expected {}".format(
                                instruction_loc, previous_loc, return_loc
                            )
                        )
                        stack = []

        if instruction.iclass == InstructionClass.ptic_call:
            return_ip = instruction.ip + instruction.size
            stack.append(return_ip)
    from ipdb import launch_ipdb_on_exception

    with launch_ipdb_on_exception():
        return builder.cfg() 
開發者ID:hase-project,項目名稱:hase,代碼行數:38,代碼來源:pt.py


注:本文中的ipdb.launch_ipdb_on_exception方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。