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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Pydev-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pydev-users

Reply via email to