V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
shyrock
V2EX  ›  Python

pycharm 下断点调试代码,总是被另外的线程乱入导致运行栈切换,该怎么办??

  •  
  •   shyrock · 2018-12-29 13:22:22 +08:00 · 1386 次点击
    这是一个创建于 1944 天前的主题,其中的信息可能已经有所发展或是发生改变。
    断点的 suspend 设为 Thread 和 All 貌似都遇到这个问题。。。

    为防止有人看不明白。假设我开了两个 http worker 来处理前端请求,
    处理函数
    def proc_request(self):
    x=x+1 <====下断点

    开始调试时,运行栈有两个:
    http worker1 <====我跟踪的这个
    http worker2

    调试大约几十秒之后,突然又跳到了上面这个断点,且运行栈切换:
    http worker2 <====当前激活的,但不是我想调试的
    http worker1 <====未中断,无法看到栈页信息
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3620 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:27 · PVG 12:27 · LAX 21:27 · JFK 00:27
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.