[PyQt] Debugging multithreaded code
haakon.bertheussen at gmail.com
Sat Feb 28 15:48:05 GMT 2009
I'm having a problem with debugging a piece of code that's being run
in a separate QThread. Specifically, any breakpoints I set in this
code will not be triggered. I've tried with both PyDev and pdb. This
is on Windows using Python 2.6.1 and PyQt 4.4.4.
See below for an example:
from PyQt4.Qt import *
print "Hello World" # attempting to break at this line
app = QApplication()
signal.signal(signal.SIGINT, signal.SIG_DFL) # exit on ctrl-c
thread = MyThread()
thread.start() # prints "Hello World", but no breakpoint encountered!
Testing with pdb:
C:\pytest\src>python -m pdb main.py
-> from PyQt4.Qt import *
(Pdb) b 6
Breakpoint 1 at c:\users\haakon\workspace\pytest\src\main.py:6
As you can see, the breakpoint never triggered. I can set breakpoints
on code that runs in the main thread just fine.
More information about the PyQt