()
| 324 | |
| 325 | |
| 326 | def breakpoint(): |
| 327 | ensure_logging() |
| 328 | if not is_client_connected(): |
| 329 | log.info("breakpoint() ignored - debugger not attached") |
| 330 | return |
| 331 | log.debug("breakpoint()") |
| 332 | |
| 333 | # Get the first frame in the stack that's not an internal frame. |
| 334 | pydb = get_global_debugger() |
| 335 | stop_at_frame = sys._getframe().f_back |
| 336 | while ( |
| 337 | stop_at_frame is not None |
| 338 | and pydb.get_file_type(stop_at_frame) == pydb.PYDEV_FILE |
| 339 | ): |
| 340 | stop_at_frame = stop_at_frame.f_back |
| 341 | |
| 342 | _settrace( |
| 343 | suspend=True, |
| 344 | trace_only_current_thread=True, |
| 345 | patch_multiprocessing=False, |
| 346 | stop_at_frame=stop_at_frame, |
| 347 | ) |
| 348 | stop_at_frame = None |
| 349 | |
| 350 | |
| 351 | def debug_this_thread(): |
no test coverage detected
searching dependent graphs…