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

Method spawn_adapter

tests/debug/session.py:451–479  ·  view source on GitHub ↗
(self, args=())

Source from the content-addressed store, hash-verified

449 time.sleep(0.1)
450
451 def spawn_adapter(self, args=()):
452 assert self.adapter is None
453 assert self.channel is None
454
455 args = self._make_python_cmdline(
456 sys.executable, os.path.dirname(debugpy.adapter.__file__), *args
457 )
458 env = self._make_env(self.spawn_adapter.env)
459
460 log.info(
461 "Spawning {0}:\n\n"
462 "Command line: {1}\n\n"
463 "Environment variables: {2}\n\n",
464 self.adapter_id,
465 json.repr(args),
466 json.repr(env),
467 )
468 self.adapter = psutil.Popen(
469 args,
470 bufsize=0,
471 stdin=subprocess.PIPE,
472 stdout=subprocess.PIPE,
473 env=env,
474 )
475 log.info("Spawned {0} with PID={1}", self.adapter_id, self.adapter.pid)
476 watchdog.register_spawn(self.adapter.pid, self.adapter_id)
477
478 stream = messaging.JsonIOStream.from_process(self.adapter, name=self.adapter_id)
479 self._start_channel(stream)
480
481 def expect_server_socket(self, port=some.int):
482 self.expected_adapter_sockets["server"] = {

Callers 3

launchFunction · 0.80
attach_pidFunction · 0.80
attach_listenFunction · 0.80

Calls 5

_make_python_cmdlineMethod · 0.95
_make_envMethod · 0.95
_start_channelMethod · 0.95
infoMethod · 0.80
from_processMethod · 0.80

Tested by

no test coverage detected