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

Method stop

pydevd_attach_to_process/winappdbg/debug.py:969–1051  ·  view source on GitHub ↗

Stops debugging all processes. If the kill on exit mode is on, debugged processes are killed when the debugger is stopped. Otherwise when the debugger stops it detaches from all debugged processes and leaves them running (default). For more details see: L{__

(self, bIgnoreExceptions=True)

Source from the content-addressed store, hash-verified

967 self.lastEvent = None
968
969 def stop(self, bIgnoreExceptions=True):
970 """
971 Stops debugging all processes.
972
973 If the kill on exit mode is on, debugged processes are killed when the
974 debugger is stopped. Otherwise when the debugger stops it detaches from
975 all debugged processes and leaves them running (default). For more
976 details see: L{__init__}
977
978 @note: This method is better than L{detach_from_all} because it can
979 gracefully handle the last debugging event before detaching.
980
981 @type bIgnoreExceptions: bool
982 @param bIgnoreExceptions: C{True} to ignore any exceptions that may be
983 raised when detaching.
984 """
985
986 # Determine if we have a last debug event that we need to continue.
987 try:
988 event = self.lastEvent
989 has_event = bool(event)
990 except Exception:
991 if not bIgnoreExceptions:
992 raise
993 e = sys.exc_info()[1]
994 warnings.warn(str(e), RuntimeWarning)
995 has_event = False
996
997 # If we do...
998 if has_event:
999 # Disable all breakpoints in the process before resuming execution.
1000 try:
1001 pid = event.get_pid()
1002 self.disable_process_breakpoints(pid)
1003 except Exception:
1004 if not bIgnoreExceptions:
1005 raise
1006 e = sys.exc_info()[1]
1007 warnings.warn(str(e), RuntimeWarning)
1008
1009 # Disable all breakpoints in the thread before resuming execution.
1010 try:
1011 tid = event.get_tid()
1012 self.disable_thread_breakpoints(tid)
1013 except Exception:
1014 if not bIgnoreExceptions:
1015 raise
1016 e = sys.exc_info()[1]
1017 warnings.warn(str(e), RuntimeWarning)
1018
1019 # Resume execution.
1020 try:
1021 event.continueDebugEvent = win32.DBG_CONTINUE
1022 self.cont(event)
1023 except Exception:
1024 if not bIgnoreExceptions:
1025 raise
1026 e = sys.exc_info()[1]

Callers 6

__exit__Method · 0.95
nextMethod · 0.95
inputhook_qt4Function · 0.45
inputhook_qt6Function · 0.45
inputhook_qt5Function · 0.45
destroy_debuggerMethod · 0.45

Calls 8

contMethod · 0.95
kill_allMethod · 0.95
detach_from_allMethod · 0.95
get_pidMethod · 0.45
get_tidMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected