eric6/DebugClients/Python/ThreadExtension.py

branch
multi_processing
changeset 7416
6f899e82f9a2
parent 7415
e953b2a449a9
child 7417
9391a330f50f
equal deleted inserted replaced
7415:e953b2a449a9 7416:6f899e82f9a2
282 282
283 @param run the run method of threading.Thread 283 @param run the run method of threading.Thread
284 @type method pointer 284 @type method pointer
285 """ 285 """
286 newThread = DebugBase(_debugClient) 286 newThread = DebugBase(_debugClient)
287 newThread.name = self.name
288
287 _debugClient.threads[self.ident] = newThread 289 _debugClient.threads[self.ident] = newThread
288 newThread.name = self.name 290 _debugClient.dumpThreadList()
291
289 # see DebugBase.bootstrap 292 # see DebugBase.bootstrap
290 sys.settrace(newThread.trace_dispatch) 293 sys.settrace(newThread.trace_dispatch)
291 try: 294 try:
292 run() 295 run()
293 except Exception: 296 except Exception:
294 excinfo = sys.exc_info() 297 excinfo = sys.exc_info()
295 newThread.user_exception(excinfo, True) 298 newThread.user_exception(excinfo, True)
296 finally: 299 finally:
297 sys.settrace(None) 300 sys.settrace(None)
301 _debugClient.dumpThreadList()
298 302
299 class ThreadWrapper(module.Thread): 303 class ThreadWrapper(module.Thread):
300 """ 304 """
301 Wrapper class for threading.Thread. 305 Wrapper class for threading.Thread.
302 """ 306 """
370 newThread = DebugBase(_debugClient) 374 newThread = DebugBase(_debugClient)
371 ident = _thread.get_ident() 375 ident = _thread.get_ident()
372 name = 'QtThread-{0}'.format(_qtThreadNumber) 376 name = 'QtThread-{0}'.format(_qtThreadNumber)
373 377
374 _qtThreadNumber += 1 378 _qtThreadNumber += 1
375 379
376 newThread.id = ident 380 newThread.id = ident
377 newThread.name = name 381 newThread.name = name
378 382
379 _debugClient.threads[ident] = newThread 383 _debugClient.threads[ident] = newThread
384 _debugClient.dumpThreadList()
380 385
381 # see DebugBase.bootstrap 386 # see DebugBase.bootstrap
382 sys.settrace(newThread.trace_dispatch) 387 sys.settrace(newThread.trace_dispatch)
383 try: 388 try:
384 run() 389 run()
388 except Exception: 393 except Exception:
389 excinfo = sys.exc_info() 394 excinfo = sys.exc_info()
390 newThread.user_exception(excinfo, True) 395 newThread.user_exception(excinfo, True)
391 finally: 396 finally:
392 sys.settrace(None) 397 sys.settrace(None)
398 _debugClient.dumpThreadList()
393 399
394 class QThreadWrapper(module.QThread): 400 class QThreadWrapper(module.QThread):
395 """ 401 """
396 Wrapper class for *.QThread. 402 Wrapper class for *.QThread.
397 """ 403 """

eric ide

mercurial