debugger.py 文件源码

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

项目:darkc0de-old-stuff 作者: tuwid 项目源码 文件源码
def _waitpid(self, wanted_pid):
        if wanted_pid:
            if wanted_pid not in self.dict:
                raise PtraceError("Unknown PID: %r" % wanted_pid, pid=wanted_pid)

            debug("Wait process %s" % wanted_pid)
            try:
                pid, status = waitpid(wanted_pid, 0)
            except OSError, err:
                if err.errno == ECHILD:
                    process = self[wanted_pid]
                    raise process.processTerminated()
                else:
                    raise err
        else:
            debug("Wait any process")
            pid, status = waitpid(-1, 0)

        if wanted_pid and pid != wanted_pid:
            raise PtraceError("Unwanted PID: %r (instead of %s)"
                % (pid, wanted_pid), pid=pid)
        return pid, status
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号