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

Method set_tracing_for_untraced_contexts

pydevd.py:1194–1236  ·  view source on GitHub ↗
(self, breakpoints_changed=False)

Source from the content-addressed store, hash-verified

1192 self.set_tracing_for_untraced_contexts(breakpoints_changed=True)
1193
1194 def set_tracing_for_untraced_contexts(self, breakpoints_changed=False):
1195 # Enable the tracing for existing threads (because there may be frames being executed that
1196 # are currently untraced).
1197 if PYDEVD_USE_SYS_MONITORING and breakpoints_changed:
1198 pydevd_sys_monitoring.update_monitor_events()
1199
1200 if IS_CPYTHON:
1201 # Note: use sys._current_frames instead of threading.enumerate() because this way
1202 # we also see C/C++ threads, not only the ones visible to the threading module.
1203 tid_to_frame = sys._current_frames()
1204
1205 ignore_thread_ids = set(
1206 t.ident
1207 for t in threadingEnumerate()
1208 if getattr(t, "is_pydev_daemon_thread", False) or getattr(t, "pydev_do_not_trace", False)
1209 )
1210
1211 for thread_ident, frame in tid_to_frame.items():
1212 if thread_ident not in ignore_thread_ids:
1213 self.set_trace_for_frame_and_parents(thread_ident, frame)
1214
1215 else:
1216 try:
1217 threads = threadingEnumerate()
1218 for t in threads:
1219 if getattr(t, "is_pydev_daemon_thread", False) or getattr(t, "pydev_do_not_trace", False):
1220 continue
1221
1222 additional_info = set_additional_thread_info(t)
1223 frame = additional_info.get_topmost_frame(t)
1224 try:
1225 if frame is not None:
1226 self.set_trace_for_frame_and_parents(t.ident, frame)
1227 finally:
1228 frame = None
1229 finally:
1230 frame = None
1231 t = None
1232 threads = None
1233 additional_info = None
1234
1235 if PYDEVD_USE_SYS_MONITORING:
1236 pydevd_sys_monitoring.restart_events()
1237
1238 @property
1239 def multi_threads_single_notification(self):

Callers 2

_locked_settraceFunction · 0.95

Calls 4

itemsMethod · 0.80
get_topmost_frameMethod · 0.80

Tested by

no test coverage detected