Django项目没有停在断点PyDev

时间:2013-11-08 13:37:43

标签: django debugging eclipse-plugin pydev breakpoints

我知道这是一个经过深思熟虑的话题,并且还有一个类似的问题已经回答here但不幸的是,阅读网上冲浪的解决方案并不适用于我。

我已经完全正确设置了所有内容,我认为描述问题的最佳方法是在Eclipse中发布我的控制台日志。

pydev debugger: starting
('Executing file ', 'D:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\manage.py')
('arguments:', "['D:\\\\workspace\\\\vimsgeomanager\\\\src\\\\videosorveglianza\\\\manage.py', 'runserver', '--noreload']")
('Connecting to ', '127.0.0.1', ':', '63320')
('Connected.',)
('received command ', '501\t1\t1.1')
sending cmd: CMD_VERSION 501    1   1.1

sending cmd: CMD_THREAD_CREATE 103  2   <xml><thread name="pydevd.reader" id="-1"/></xml>

sending cmd: CMD_THREAD_CREATE 103  4   <xml><thread name="pydevd.writer" id="-1"/></xml>

('received command ', '111\t3\tD:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\Contrib\\VimsNVRX\\drivers\\NVRX_Manager.py\t32\t**FUNC**connect\tNone')
Added breakpoint:d:\workspace\vimsgeomanager\src\videosorveglianza\contrib\vimsnvrx\drivers\nvrx_manager.py - line:32 - func_name:connect
('received command ', '111\t5\tD:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\Contrib\\VimsNVRX\\drivers\\NVRX_Manager.py\t35\t**FUNC**connect\tNone')
Added breakpoint:d:\workspace\vimsgeomanager\src\videosorveglianza\contrib\vimsnvrx\drivers\nvrx_manager.py - line:35 - func_name:connect
('received command ', '111\t7\tD:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\Contrib\\VimsNVRX\\drivers\\NVRX.py\t467\t**FUNC**getStreamCaps\tNone')
Added breakpoint:d:\workspace\vimsgeomanager\src\videosorveglianza\contrib\vimsnvrx\drivers\nvrx.py - line:467 - func_name:getStreamCaps
('received command ', '122\t9\t;;')
Exceptions to hook : []
('received command ', '124\t11\t')
('received command ', '101\t13\t')
ContribUtils.appendConf: considero la cartella D:\workspace\vimsgeomanager\src\videosorveglianza\conf\contrib
MODALITA' SINGOLO SERVER
SETTINGS DI DEBUG: trovato specialconf
ContribUtils.appendConf: considero la cartella D:\workspace\vimsgeomanager\src\videosorveglianza\conf\contrib
MODALITA' SINGOLO SERVER
SETTINGS DI DEBUG: trovato specialconf
Validating models...
0 errors found

Django version 1.2, using settings 'videosorveglianza.settings'
Development server is running at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
sending cmd: CMD_THREAD_CREATE 103  6   <xml><thread name="MainThread" id="pid4420_seq4" /></xml>

('received command ', '112\t15\tD:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\Contrib\\VimsNVRX\\drivers\\NVRX_Manager.py\t35')
Removed breakpoint:d:\workspace\vimsgeomanager\src\videosorveglianza\contrib\vimsnvrx\drivers\nvrx_manager.py
('received command ', '111\t17\tD:\\workspace\\vimsgeomanager\\src\\videosorveglianza\\Contrib\\VimsNVRX\\drivers\\NVRX_Manager.py\t35\t**FUNC**connect\tNone')
Added breakpoint:d:\workspace\vimsgeomanager\src\videosorveglianza\contrib\vimsnvrx\drivers\nvrx_manager.py - line:35 - func_name:connect

服务器在每次请求时都正确回答,唯一的问题是它在断点处没有阻塞;更确切地说,它只适用于在manage.py

中添加的断点

为了避免误解,我在我的机器上有服务器代码,它是一个Eclipse项目,所以我不想使用PyDev提供的远程调试工具。我想简单地设置断点并在执行时停止代码。

我已经尝试更改PyDev的常量

DEBUG_TRACE_LEVEL
DEBUG_TRACE_BREAKPOINTS

非常感谢您提供的所有提示!

1 个答案:

答案 0 :(得分:1)

我的报告中没有发现任何错误。

当一切似乎都工作但调试器停止工作时,一件事就是如果你的代码中有一些无限递归(并在某处处理它),那么Python有一个问题就是它会自动禁用跟踪(从而删除调试器) - 我已经看到它发生在更多的情况下,由于一些Python错误导致跟踪停止的问题。

请参阅:https://stackoverflow.com/a/9502960/110451以获取此类问题,并检查是否可能出现这种情况 - 尤其是定义了跟踪函数(trace_func)并使用sys.settrace设置以检查跟踪是否停止的部分时间。