Debug web2py using Eclipse

I am using Eclipse (with PyDev) to uninstall a web2py application. I followed this guide to set up the situation. Now I want to debug my application using Eclipse. However, for some reason, execution does not stop (always) when it reaches a breakpoint.

I created two separate applications for web2py (in two Eclipse projects). Debugging seems to work on one, but not on the other. Both projects reference the same web2py installation. Thus, no matter which project I run ... / Debug ... in Eclipse, web2py offers both applications through a browser.

I created a simple test file (controllers / test.py) as follows:

def index():
    print 'I should break.'
    print 'After the breakpoint'
    return dict(test=1)

There is a breakpoint set for the first statement print.

I put this file in both projects (call them A and B).

I have the following observations:

When I start debugging from Eclipse, the debugger stops execution whenever I click on a breakpoint in the test.py file that belongs to project A, but it seems to ignore the breakpoint in the test.py file that belongs to project B. It doesn't matter, Whether I launched the web2py (Eclipse-) A project or the B project. The behavior is always the same. Breakpoints in files that belong to the work of project A, those in project B, are ignored.

I compared all the properties of the project and ran the configuration properties, and I can not find the difference (except for the name and path of the project).

Doing both projects works great. For example, the output from the printtest file instructions shown above is always displayed in the Eclipse console.

- , ? , A, B?

Python 2.7.1.

DEBUG_TRACE_LEVEL = 3 
DEBUG_TRACE_BREAKPOINTS = 3 

eclipse/plugins/org.python.pydev.debug/pysrc/pydevd_constants.py( ), :

pydev:   ( " ", "C:\misc\web2py_src\web2py\web2py.py" )   ('arguments:', '[' C:\\misc\\web2py_src\\web2py\\web2py.py '] ")   (" "," 127.0.0.1 ",": "," 49565")   ('.',)   (' ', '501\t1\t1.1')    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\tC:\\misc\\workspace\\Newtoon\\controllers\\test.py\t12\t**FUNC**index\tNone')
Added breakpoint:c:\misc\workspace\newtoon\controllers\test.py - line:12 - func_name:index
('received command ', '111\t5\tC:\\misc\\workspace\\Newtoon\\controllers\\importer.py\t11\t**FUNC**index\tNone')
Added breakpoint:c:\misc\workspace\newtoon\controllers\importer.py - line:11 - func_name:index
('received command ', '111\t7\tC:\\misc\\web2py_src\\web2py\\applications\\GeorgsTestApp\\controllers\\unique_names.py\t6\t**FUNC**index\tNone')
Added breakpoint:c:\misc\web2py_src\web2py\applications\georgstestapp\controllers\unique_names.py - line:6 - func_name:index
('received command ', '111\t9\tC:\\misc\\web2py_src\\web2py\\applications\\GeorgsTestApp\\controllers\\test.py\t12\t**FUNC**index\tNone')
Added breakpoint:c:\misc\web2py_src\web2py\applications\georgstestapp\controllers\test.py - line:12 - func_name:index
('received command ', '122\t11\t;;')
Exceptions to hook : []
('received command ', '124\t13\t')
('received command ', '101\t15\t')
No handlers could be found for logger "web2py"
web2py Web Framework
Created by Massimo Di Pierro, Copyright 2007-2011
Version 1.99.4 (2011-12-14 14:46:14) stable
Database drivers available: SQLite3, pymysql
Starting hardcron...
WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
sending cmd: CMD_THREAD_CREATE 103  6   <xml><thread name="MainThread" id="pid5740_seq4" /></xml>

sending cmd: CMD_THREAD_CREATE 103  8   <xml><thread name="Thread-4" id="pid5740_seq5" /></xml>

please visit:
    http://127.0.0.1:8000
starting browser...
sending cmd: CMD_THREAD_CREATE 103  10  <xml><thread name="Dummy-7" id="pid5740_seq6" /></xml>

sending cmd: CMD_THREAD_CREATE 103  12  <xml><thread name="Dummy-6" id="pid5740_seq7" /></xml>

sending cmd: CMD_THREAD_CREATE 103  14  <xml><thread name="Thread-13" id="pid5740_seq8" /></xml>

sending cmd: CMD_THREAD_CREATE 103  16  <xml><thread name="Thread-10" id="pid5740_seq9" /></xml>

sending cmd: CMD_THREAD_CREATE 103  18  <xml><thread name="Thread-11" id="pid5740_seq10" /></xml>

sending cmd: CMD_THREAD_CREATE 103  20  <xml><thread name="Port8000" id="pid5740_seq11" /></xml>

sending cmd: CMD_THREAD_CREATE 103  22  <xml><thread name="Thread-12" id="pid5740_seq12" /></xml>

sending cmd: CMD_THREAD_CREATE 103  24  <xml><thread name="Thread-8" id="pid5740_seq13" /></xml>

sending cmd: CMD_THREAD_CREATE 103  26  <xml><thread name="Thread-9" id="pid5740_seq14" /></xml>

sending cmd: CMD_THREAD_CREATE 103  28  <xml><thread name="Thread-16" id="pid5740_seq15" /></xml>

sending cmd: CMD_THREAD_CREATE 103  30  <xml><thread name="Thread-15" id="pid5740_seq16" /></xml>

sending cmd: CMD_THREAD_CREATE 103  32  <xml><thread name="Thread-18" id="pid5740_seq17" /></xml>

sending cmd: CMD_THREAD_CREATE 103  34  <xml><thread name="Thread-14" id="pid5740_seq18" /></xml>

sending cmd: CMD_THREAD_CREATE 103  36  <xml><thread name="Thread-17" id="pid5740_seq19" /></xml>

WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
I should break.
After the breakpoint
sending cmd: CMD_THREAD_SUSPEND 105 38  <xml><thread id="pid5740_seq12" stop_reason="111"><frame id="97199496" name="index" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Capplications%255Cgeorgstestapp%255Ccontrollers%255Ctest.py" line="12">"</frame><frame id="95957960" name="%26lt%3Blambda%26gt%3B" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Cglobals.py" line="172">"</frame><frame id="100912680" name="%26lt%3Bmodule%26gt%3B" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Capplications%255Cgeorgstestapp%255Ccontrollers%255Ctest.py" line="19">"</frame><frame id="66219576" name="restricted" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Crestricted.py" line="204">"</frame><frame id="96138760" name="run_controller_in" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Ccompileapp.py" line="537">"</frame><frame id="96513256" name="serve_controller" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Cmain.py" line="202">"</frame><frame id="62835496" name="wsgibase" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Cmain.py" line="493">"</frame><frame id="62834872" name="app_with_logging" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Cmain.py" line="676">"</frame><frame id="96071288" name="run_app" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Crocket.py" line="1994">"</frame><frame id="66212296" name="run" file="c%253A%255Cmisc%255Cweb2py_src%255Cweb2py%255Cgluon%255Crocket.py" line="1302">"</frame><frame id="95948632" name="__bootstrap_inner" file="c%253A%255Cpython27%255Clib%255Cthreading.py" line="530">"</frame><frame id="96053672" name="__bootstrap" file="c%253A%255Cpython27%255Clib%255Cthreading.py" line="503">"</frame></thread></xml>

WARNING:web2py.cron:WEB2PY CRON: Disabled because no file locking
('received command ', '106\t17\tpid5740_seq12')
('processing internal command ', '<pydevd_comm.InternalRunThread instance at 0x0000000005F82E88>')
I should break.
After the breakpoint
sending cmd: CMD_THREAD_RUN 106 40  pid5740_seq12   None

. B , A.

+5
1

, ( pydev ).

, , , , web2py.

+1

All Articles