visualstudio_py_debugger.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:AutoDiff 作者: icewall 项目源码 文件源码
def ShouldBreak(self, thread, ex_type, ex_value, trace):
        probe_stack()
        name = ex_type.__module__ + '.' + ex_type.__name__
        mode = self.break_on.get(name, self.default_mode)
        break_type = BREAK_TYPE_NONE
        if mode & BREAK_MODE_ALWAYS:
            if self.IsHandled(thread, ex_type, ex_value, trace):
                break_type = BREAK_TYPE_HANDLED
            else:
                break_type = BREAK_TYPE_UNHANLDED
        elif (mode & BREAK_MODE_UNHANDLED) and not self.IsHandled(thread, ex_type, ex_value, trace):
            break_type = BREAK_TYPE_HANDLED

        if break_type:
            if issubclass(ex_type, SystemExit):
                if not BREAK_ON_SYSTEMEXIT_ZERO:
                    if ((isinstance(ex_value, int) and not ex_value) or 
                        (isinstance(ex_value, SystemExit) and not ex_value.code)):
                        break_type = BREAK_TYPE_NONE

        return break_type
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号