#468 Allow break points in background thread

Don Kirkby

It seems that PyDev only triggers break points from the main thread. Break points in background threads seem to be ignored. Here's some example code:

import thread

def go(count):
print 'count is %d.' % count # set break point here

print 'calling from main thread:'
print 'calling from bg thread:'
thread.start_new_thread(go, (23,))

raw_input('press enter to quit.')

That breakpoint is hit with count 13, but not 23. This Stack Overflow question has a bit more detail and some work arounds:


  • Fabio Zadrozny
    Fabio Zadrozny

    Fixed for 1.6.0 (nightly build available in some hours).

  • Fabio Zadrozny
    Fabio Zadrozny

    • status: open --> closed-fixed

  • Anonymous

    surprisingly enough i have the same issue in pydev 2.6. I have a GUI app where class A starts class B(QtCore.QThread) and debugger doesn't stop in the B methods, while the code is executed. If I'm trying to step into the b.start() call debugger sends me to the end of "main" construct

  • Don Kirkby
    Don Kirkby

    Are you saying that you tried to step into the b.start() method? That won't work because the start() method launches a separate thread and immediately returns. Stepping through code only steps within a single thread. If you want to step through code in the other thread, you have to place a break point on some code that runs in the other thread. Once you hit that breakpoint, you can step through code normally.


  • Anonymous

    I'm saying that If I'm placing a breakpoint inside B class code it doesn't work.
    I understood your remark about trying to step into the b.start() method, but it is not what causing me troubles. I shouldn't even mention it probably to avoid confusion.

    Anyway the point is GUI app with PyQt - debugger doesn't stop on the breakpoints that are placed inside the code that is running in a separate thread.