MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / on_thread_suspend

Method on_thread_suspend

pydevd.py:423–448  ·  view source on GitHub ↗
(self, thread_id, thread, stop_reason)

Source from the content-addressed store, hash-verified

421 self.send_suspend_notification(thread_id, thread, CMD_THREAD_SUSPEND)
422
423 def on_thread_suspend(self, thread_id, thread, stop_reason):
424 with self._lock:
425 pause_requested = self._pause_requested
426 if pause_requested:
427 # When a suspend notification is sent, reset the pause flag.
428 self._pause_requested = False
429
430 self._suspended_thread_id_to_thread[thread_id] = thread
431
432 # CMD_THREAD_SUSPEND should always be a side-effect of a break, so, only
433 # issue for a CMD_THREAD_SUSPEND if a pause is pending.
434 if stop_reason != CMD_THREAD_SUSPEND or pause_requested:
435 if self._suspend_time_request > self._last_suspend_notification_time:
436 pydev_log.info("Sending suspend notification.")
437 self._last_suspend_notification_time = self._suspend_time_request
438 self.send_suspend_notification(thread_id, thread, stop_reason)
439 else:
440 pydev_log.info(
441 "Suspend not sent (it was already sent). Last suspend % <= Last resume %s",
442 self._last_suspend_notification_time,
443 self._last_resume_notification_time,
444 )
445 else:
446 pydev_log.info(
447 "Suspend not sent because stop reason is thread suspend and pause was not requested.",
448 )
449
450 def on_thread_resume(self, thread_id, thread):
451 # on resume (step, continue all):

Callers 2

Calls 2

infoMethod · 0.80

Tested by

no test coverage detected