I have a python script which runs few threads. Usually, when I want to debug a python script I run it with "-m pdb" and then setup a break point inside with "b ". However, for some reason it doesn't stop at the break point even it passed through that line and even I saw the break point was actually added. Any idea what I'm doing wrong? I used a simple example for python threading module from here
import threading
class SummingThread(threading.Thread):
     def __init__(self,low,high):
         threading.Thread.__init__(self)
         self.low=low
         self.high=high
         self.total=0
     def run(self):
         print 'self.low = ' + str(self.low) + ', self.high = ' + str(self.high)
         for i in range(self.low,self.high):
             self.total+=i
thread1 = SummingThread(0,500000)
thread2 = SummingThread(500000,1000000)
thread1.start() # This actually causes the thread to run
thread2.start()
thread1.join()  # This waits until the thread has completed
thread2.join()
# At this point, both threads have completed
result = thread1.total + thread2.total
print result
Then I add a break point inside the run method on the line with the print command and run the script. The script runs, passes through the print command but doesn't stop.
~$ python -m pdb test.py
> /home/user/test.py(1)<module>()
-> import threading
(Pdb) b 11
Breakpoint 1 at /home/user/test.py:11
(Pdb) r
self.low = 0, self.high = 500000
 self.low = 500000, self.high = 1000000
499999500000
--Return--
> /home/user/test.py(24)<module>()->None
-> print result
(Pdb) q
 
     
    