0

我知道这是一个长期讨论的话题,并且这里也回答了一个类似的问题,但不幸的是,网上冲浪的解决方案对我不起作用。

我已经正确设置了所有内容,我认为描述问题的最佳方法是在 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

非常感谢您提供的每一个提示!

4

1 回答 1

1

从你的报告中我看不出有什么问题。

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

有关此类问题,请参见:https : //stackoverflow.com/a/9502960/110451,并检查您的情况是否如此——尤其是定义跟踪函数 (trace_func) 并使用 sys.settrace 设置以检查是否追踪有时会停止。

于 2013-11-11T17:06:28.953 回答