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

Method __init__

tests/debug/session.py:78–226  ·  view source on GitHub ↗
(self, debug_config=None)

Source from the content-addressed store, hash-verified

76 cls._counter = itertools.count(1)
77
78 def __init__(self, debug_config=None):
79 assert Session.tmpdir is not None
80 watchdog.start()
81
82 self.id = next(Session._counter)
83 log.info("Starting {0}", self)
84
85 self.client_id = "vscode"
86
87 self.capabilities = {
88 "pathFormat": "path",
89 "clientID": self.client_id,
90 "adapterID": "test",
91 "linesStartAt1": True,
92 "columnsStartAt1": True,
93 "supportsVariableType": True,
94 "supportsRunInTerminalRequest": True,
95 "supportsArgsCanBeInterpretedByShell": True,
96 "supportsStartDebuggingRequest": False,
97 }
98
99 self.debuggee = None
100 """psutil.Popen instance for the debuggee process."""
101
102 self.adapter = None
103 """psutil.Popen instance for the adapter process."""
104
105 self.expected_adapter_sockets = {
106 "client": {"host": some.str, "port": some.int, "internal": False},
107 }
108 """The sockets which the adapter is expected to report."""
109
110 self.adapter_endpoints = None
111 """Name of the file that contains the adapter endpoints information.
112
113 This file is generated by the adapter when it opens the listener sockets,
114 and deleted by it when it exits.
115 """
116
117 self.channel = None
118 """JsonMessageChannel to the adapter."""
119
120 self.captured_output = {"stdout", "stderr"}
121 """Before the debuggee is spawned, this is the set of stdio streams that
122 should be captured once it is spawned.
123
124 After it is spawned, this is a CapturedOutput object capturing those streams.
125 """
126
127 self.backchannel = None
128 """The BackChannel object to talk to the debuggee.
129
130 Must be explicitly created with open_backchannel().
131 """
132
133 self.scratchpad = comms.ScratchPad(self)
134 """The ScratchPad object to talk to the debuggee."""
135

Callers

nothing calls this directly

Calls 3

infoMethod · 0.80
spawn_debuggeeFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected