Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#468 Allow break points in background thread

closed-fixed
nobody
None
5
2010-07-14
2010-06-25
Don Kirkby
No

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:'
go(13)
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:
http://stackoverflow.com/questions/3114719

Discussion

  • Fabio Zadrozny
    Fabio Zadrozny
    2010-07-14

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

     
  • Fabio Zadrozny
    Fabio Zadrozny
    2010-07-14

    • status: open --> closed-fixed
     

  • Anonymous
    2012-10-10

    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
    2012-10-10

    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
    2012-10-18

    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.