Thread: [Pydev-users] [pydev - Users] ZOPE: Breakpoints in external Python methodes
Brought to you by:
fabioz
|
From: SourceForge.net <no...@so...> - 2006-11-09 10:48:10
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003811 By: chrordig Hi, I am trying to debug an external Python methode in ZOPE. I started ZOPE's run.py with all the necessary environment variables and command line parameters set. In zope.conf I have debug-mode on. When suspending the run.py in the debug view, everything is fine, and I can see ZOPE's internal variables and such stuff, but when I set breakpoints in one of my products .py files the debugger doesn't break there. Is this kind of debugging impossible, or am I doing something wrong? I am using Eclipse 3.2, PyDev 1.2.5 and ZOPE's python interpreter in version 2.3.5. Thanks for any hint. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 10:50:42
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003815 By: fabioz Should be possible... are your files within a python project (there's currently a limitation that only let's you add breakpoints in files that are under a project in eclipse). ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 11:07:37
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003842 By: chrordig Yes they are. My ZOPE install is under C:\Programme\ZopeDevel\ and this is also the root of my whole Python Project. The file I wish to break into is under C:\Programme\ZopeDevel\Data\Products\MyProduct\Invoice\ I am trying to trigger the breakpoint by using the "Test" tab in the ZMI. Thanks. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 11:12:49
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003850 By: fabioz Can you go into org.python.pydev.debug/pysrc/pydevd_comm.py and set pydevd_trace_breakpoints=1 (and see if the breakpoints are being added) ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 11:22:43
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003864 By: chrordig It seems to be added correctly: Added breakpoint:c:\programme\zopedevel\data\products\myproduct\skins\invoice\fi lltrips.py - line:24 ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 11:32:53
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003879 By: fabioz Can you put: print filename,base in line 18 of pydevd_frame.py (to see if it is getting to the frame to debug correctly)... this should give an output for each new frame, so, you may have lots of output there (just check if the file is appearing there). ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 11:37:02
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003886 By: chrordig it furthermore seems it cannot suspend anything, but the MainThread: Traceback (most recent call last): AttributeError: '_DummyThread' object has no attribute 'additionalInfo' Traceback (most recent call last): File "C:\Programme\eclipse\plugins\org.python.pydev.debug_1.2.5\pysrc\pydevd.py", line 257, in processNetCommand self.setSuspend(t, CMD_THREAD_SUSPEND) File "C:\Programme\eclipse\plugins\org.python.pydev.debug_1.2.5\pysrc\pydevd.py", line 383, in setSuspend thread.additionalInfo.pydev_state = PyDB.STATE_SUSPEND AttributeError: '_DummyThread' object has no attribute 'additionalInfo' Traceback (most recent call last): AttributeError: '_DummyThread' object has no attribute 'additionalInfo' Traceback (most recent call last): File "C:\Programme\eclipse\plugins\org.python.pydev.debug_1.2.5\pysrc\pydevd.py", line 257, in processNetCommand self.setSuspend(t, CMD_THREAD_SUSPEND) File "C:\Programme\eclipse\plugins\org.python.pydev.debug_1.2.5\pysrc\pydevd.py", line 383, in setSuspend thread.additionalInfo.pydev_state = PyDB.STATE_SUSPEND AttributeError: '_DummyThread' object has no attribute 'additionalInfo' I'll check the print output now... ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 12:03:26
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003912 By: chrordig The file does not appear there. It seems nothing from the Products dir appears there while running the "Test" from ZMI. The only things I see repeating are: c:\programme\zopedevel\python\lib\asynchat.py asynchat.py c:\programme\zopedevel\zope\lib\python\zserver\httpserver.py httpserver.py c:\programme\zopedevel\zope\lib\python\zserver\medusa\http_server.py http_server.py c:\programme\zopedevel\zope\lib\python\zserver\medusa\thread\select_trigger.py select_trigger.py c:\programme\zopedevel\zope\lib\python\zserver\medusa\thread\select_trigger.py select_trigger.py c:\programme\zopedevel\python\lib\asyncore.py asyncore.py c:\programme\zopedevel\python\lib\asynchat.py asynchat.py I've also reduced output by filtering: if 'fillTrips' in filename: print filename,base but it never shows there. Might it be a problem, that fillTrips.py is run by ZOPE's restricted Pyhon? ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 12:12:45
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003925 By: fabioz Hummm... try with the filter: if 'filltrips' in filename.lower(): because I'm not sure if the case is kept after normalizing the file for the breakpoint... ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 12:29:15
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003937 By: chrordig the filtered run was the second try. Even with absolutely unfiltered output the file name is not shown when testing. ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 12:32:16
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4003944 By: fabioz Strange... it appears that it has something to do with that DummyThread... do you know why it is using that thread and not the actual thread from the threading module? ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-11-09 13:32:36
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4004038 By: chrordig I don't know. It is too deep inside ZOPE, and I am not an expert when it comes to ZOPE interna :-( ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |
|
From: SourceForge.net <no...@so...> - 2006-12-05 20:47:53
|
Read and respond to this message at: https://sourceforge.net/forum/message.php?msg_id=4045227 By: patricksmith I am having the same trouble. I'm running (evaluating, really) PyDev Extensions 1.2.5 in Eclipse 3.2.1 and I have the full source for Zope and Plone in my eclipse environment: Plone 2.5.2 (svn/unreleased), (https://svn.plone.org/svn/plone/bundles/2.5-zope29) CMF-1.6.2, Zope (unreleased version, python 2.4.3, win32), (svn://svn.zope.org/repos/main/Zope/branches/2.9) Five 1.3.8, Python 2.4.3 (#69, Mar 29 2006, 17:35:34) [MSC v.1310 32 bit (Intel)], PIL 1.1.5 I have keyword completion set up and can successfully lookup/browse source. (Definitely awesome!) My trouble is with using the debugger. I can see that the breakpoint is added by setting "pydevd_trace_breakpoints = 1". I do not see the frame added for my code via "print filename,base in line 18 of pydevd_frame.py". I can suspend the main thread but not the others, though trying to do so has no effect, not even a thrown exception. There are a couple of comments that I have to add: [1] If a breakpoint is set by double clicking in the margin on a blank line, it will not be moved to a line with a python statement as in the Eclipse Java editor. Breakpoints on blank lines will not be hit and they will only be hit after moving them to a line with python code. [2] Breakpoints set in Zope/Plone/Custom Product code that is executed on the main thread are hit while those that are on the dummy threads are not. [3] If I create a simple script that launches a Thread, breakpoints in both threads get hit. If the simple script launches a _DummyThread, only the breakpoint in the main thread gets his and trying to hit the _DummyThread causes an exception: #========Simple Script begin # set breakpoints on the print statements! import threading class MyThread(threading.Thread): # works! #class MyThread(threading._DummyThread): # doesn't work def run(self): #import pydevd; pydevd.settrace() # uncomment the call to remote debugger above # or just set breakpoint on the next line print 'in the thread' print 'about to spawn a thread!' MyThread().start() print 'the thread was spawned' #========Simple Script end =========The exception caused when using _DummyThread: Error reading ThreadSuspended org.eclipse.core.runtime.CoreException: Unexpected XML error reading: <xml><thread id="12143408" stop_reason="108"> <frame id="13276376" name="?" file="e%3A%5Cdev%5C2.5%5Cproducts%5Copenengagementdms%5Ccontent%5Coutside.py" line="13">"</frame> <frame id="12454752" name="run" file="e%3A%5Cprogram files%5Ceclipse%5Cplugins%5Corg.python.pydev.debug_1.2.5%5Cpysrc%5Cpydevd.py" line="524">"</frame> <frame id="10939440" name="?" file="e%3A%5Cprogram files%5Ceclipse%5Cplugins%5Corg.python.pydev.debug_1.2.5%5Cpysrc%5Cpydevd.py" line="668">"</frame> </thread></xml> at org.python.pydev.debug.model.XMLUtils.XMLToStack(XMLUtils.java:235) at org.python.pydev.debug.model.AbstractDebugTarget.processThreadSuspended(Abst ractDebugTarget.java:331) at org.python.pydev.debug.model.AbstractDebugTarget.processCommand(AbstractDebu gTarget.java:211) at org.python.pydev.debug.model.remote.DebuggerReader.processCommand(DebuggerRe ader.java:96) at org.python.pydev.debug.model.remote.DebuggerReader.run(DebuggerReader.java:1 20) at java.lang.Thread.run(Unknown Source) org.eclipse.core.runtime.CoreException[4]: org.xml.sax.SAXException: Thread not found (12143408) at org.python.pydev.debug.model.XMLUtils$XMLToStackInfo.startThread(XMLUtils.ja va:147) at org.python.pydev.debug.model.XMLUtils$XMLToStackInfo.startElement(XMLUtils.j ava:202) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanS tartElement(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$Fragm entContentDispatcher.dispatch(Unknown Source) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanD ocument(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at javax.xml.parsers.SAXParser.parse(Unknown Source) at org.python.pydev.debug.model.XMLUtils.XMLToStack(XMLUtils.java:225) at org.python.pydev.debug.model.AbstractDebugTarget.processThreadSuspended(Abst ractDebugTarget.java:331) at org.python.pydev.debug.model.AbstractDebugTarget.processCommand(AbstractDebu gTarget.java:211) at org.python.pydev.debug.model.remote.DebuggerReader.processCommand(DebuggerRe ader.java:96) at org.python.pydev.debug.model.remote.DebuggerReader.run(DebuggerReader.java:1 20) at java.lang.Thread.run(Unknown Source) [3] To hit a breakpoint on Zope code executed outside the main thread, I am using the remote debugger and pydevd.settrace(). It is slightly less than ideal, but only just. I am able to step through my code! ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/forum/unmonitor.php?forum_id=293649 |