当前位置: 首页>>代码示例>>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;未经允许,请勿转载。