MCPcopy Create free account
hub / github.com/microsoft/debugpy / breakpoint

Function breakpoint

src/debugpy/server/api.py:326–348  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

324
325
326def 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
351def debug_this_thread():

Calls 6

get_global_debuggerFunction · 0.90
ensure_loggingFunction · 0.85
_settraceFunction · 0.85
infoMethod · 0.80
get_file_typeMethod · 0.80
is_client_connectedFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…