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

Method set_trace_for_frame_and_parents

pydevd.py:2391–2438  ·  view source on GitHub ↗
(self, thread_ident: Optional[int], frame, **kwargs)

Source from the content-addressed store, hash-verified

2389 frame = None
2390
2391 def set_trace_for_frame_and_parents(self, thread_ident: Optional[int], frame, **kwargs):
2392 disable = kwargs.pop("disable", False)
2393 assert not kwargs
2394
2395 DEBUG = True # 'defaulttags' in frame.f_code.co_filename
2396
2397 while frame is not None:
2398 if not isinstance(frame, FrameType):
2399 # This is the case for django/jinja frames.
2400 frame = frame.f_back
2401 continue
2402
2403 # Don't change the tracing on debugger-related files
2404 file_type = self.get_file_type(frame)
2405 if PYDEVD_USE_SYS_MONITORING:
2406 if file_type is None:
2407 if disable:
2408 if DEBUG:
2409 pydev_log.debug("Disable tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2410 pydevd_sys_monitoring.disable_code_tracing(frame.f_code)
2411
2412 else:
2413 if DEBUG:
2414 pydev_log.debug("Set tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2415 pydevd_sys_monitoring.enable_code_tracing(thread_ident, frame.f_code, frame)
2416 else:
2417 if DEBUG:
2418 pydev_log.debug("SKIP set tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2419 else:
2420 # Not using sys.monitoring.
2421 if file_type is None:
2422 if disable:
2423 if DEBUG:
2424 pydev_log.debug("Disable tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2425 if frame.f_trace is not None and frame.f_trace is not NO_FTRACE:
2426 frame.f_trace = NO_FTRACE
2427
2428 elif frame.f_trace is not self.trace_dispatch:
2429 if DEBUG:
2430 pydev_log.debug("Set tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2431 frame.f_trace = self.trace_dispatch
2432 else:
2433 if DEBUG:
2434 pydev_log.debug("SKIP set tracing of frame: %s - %s", frame.f_code.co_filename, frame.f_code.co_name)
2435
2436 frame = frame.f_back
2437
2438 del frame
2439
2440 def _create_pydb_command_thread(self):
2441 curr_pydb_command_thread = self.py_db_command_thread

Callers 8

set_suspendMethod · 0.95
_do_wait_suspendMethod · 0.95
_locked_settraceFunction · 0.95
_stop_on_returnFunction · 0.80
suspend_all_threadsFunction · 0.80
trace_dispatchMethod · 0.80
handle_exceptionFunction · 0.80

Calls 2

get_file_typeMethod · 0.95
popMethod · 0.80

Tested by

no test coverage detected