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

Function start_debugging

src/debugpy/server/cli.py:319–340  ·  view source on GitHub ↗
(argv_0)

Source from the content-addressed store, hash-verified

317
318
319def start_debugging(argv_0):
320 # We need to set up sys.argv[0] before invoking either listen() or connect(),
321 # because they use it to report the "process" event. Thus, we can't rely on
322 # run_path() and run_module() doing that, even though they will eventually.
323 sys.argv[0] = argv_0
324
325 log.debug("sys.argv after patching: {0!r}", sys.argv)
326
327 debugpy.configure(options.config)
328
329 if os.environ.get("DEBUGPY_RUNNING", "false") != "true":
330 if options.mode == "listen" and options.address is not None:
331 debugpy.listen(options.address)
332 elif options.mode == "connect" and options.address is not None:
333 debugpy.connect(options.address, access_token=options.adapter_access_token, parent_session_pid=options.parent_session_pid)
334 else:
335 raise AssertionError(repr(options.mode))
336
337 if options.wait_for_client:
338 debugpy.wait_for_client()
339
340 os.environ["DEBUGPY_RUNNING"] = "true"
341
342
343def run_file():

Callers 3

run_fileFunction · 0.85
run_moduleFunction · 0.85
run_codeFunction · 0.85

Calls 5

reprFunction · 0.85
listenMethod · 0.80
configureMethod · 0.45
getMethod · 0.45
connectMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…