0

I know it is a long discussed topic and that there is also a similar question answered here but unfortunately the solutions read surfing the web are not working for me.

I have everything fully set up correctly, I think the best way to describe the issue is by posting a log of my console inside 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

The server is answering correctly at every request, the only thing is that it is not blocking at breakpoints; to be more precise it is only working on breakpoints added in manage.py

Just to avoid misunderstanding, I have the server's code on my machine and it is an Eclipse project so I don't want to use the remote debugger tool offered by PyDev. I'd like to simply put a breakpoint and stop the code at its execution.

I've already tried to change the PyDev's constants

DEBUG_TRACE_LEVEL
DEBUG_TRACE_BREAKPOINTS

Thank you very much for every hint provided!

Community
  • 1
  • 1
Luigi Tiburzi
  • 4,265
  • 7
  • 32
  • 43

1 Answers1

1

I don't see anything wrong from your report.

The one thing when everything seems to work but the debugger stops working is that if you have some infinite recursion in your code (and handle it somewhere), Python has an issue where it disables the tracing automatically (thus removing the debugger) -- and I've seen it happen in a couple more occasions which had issues where the tracing would just stop because of some Python bug.

See: https://stackoverflow.com/a/9502960/110451 for such a question and check if this may be your case -- especially the part where a tracing function (trace_func) is defined and set with sys.settrace to check if the tracing stops at some time.

Community
  • 1
  • 1
Fabio Zadrozny
  • 24,814
  • 4
  • 66
  • 78
  • Thank you very much for your reply. The one thing I thought is the following, I don't know if I'm right. The breakpoints work if I, for example, put them in the manage.py or the files called immediately after it. Then I put a breakpoint in urls.py, or a file called by it, and the BP doesn't work BUT it works if I put it using the remote server debugger. So my thought is, couldn't it be that the debugger "thinks" the program is ended after the configuration? Because the call to urls.py is not determined so the program cannot know when it will happen. – Luigi Tiburzi Nov 11 '13 at 17:23
  • The remote debugger makes the tracing regardless of the current state, so, it should work regardless... as for the original problem, the most common case is some of your code breaking the Python tracing (which is a bit fragile) -- so, if the trace_func() in that answer doesn't run properly all to the end of your program, then it might signal an issue in your code which may have to be fixed (such as triggering an infinite recursion). – Fabio Zadrozny Nov 11 '13 at 17:43
  • Ok so for example if now I'm getting no outout from the trace_func() it means there is some problem in the Python code but the problem is handled in the background so I can still have it running, right? – Luigi Tiburzi Nov 12 '13 at 07:57
  • 1
    Actually, you should get the output up to some point (note that you should run your code in regular mode -- i.e.: not debug mode -- to see the output and check where the output stops printing to find out about the place where the trace function stops working). – Fabio Zadrozny Nov 12 '13 at 12:26