MCPcopy Index your code
hub / github.com/Marus/cortex-debug / resetDevice

Method resetDevice

src/frontend/extension.ts:156–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

154 }
155
156 private resetDevice() {
157 let session = CortexDebugExtension.getActiveCDSession();
158 if (session) {
159 let mySession = CDebugSession.FindSession(session);
160 const parentConfig = mySession.config?.pvtParent;
161 while (mySession && parentConfig) {
162 // We have a parent. See if our life-cycle is managed by our parent, if so
163 // send a reset to the parent instead
164 const chConfig = mySession.config?.pvtMyConfigFromParent as ChainedConfig;
165 if (chConfig?.lifecycleManagedByParent && parentConfig.__sessionId) {
166 // __sessionId is not documented but has existed forever and used by VSCode itself
167 mySession = CDebugSession.FindSessionById(parentConfig.__sessionId);
168 if (!mySession) {
169 break;
170 }
171 session = mySession.session || session;
172 } else {
173 break;
174 }
175 }
176 session.customRequest('reset-device', 'reset');
177 }
178 }
179
180 private startServerConsole(context: vscode.ExtensionContext, logFName: string = ''): Promise<void> {
181 return new Promise<void>((resolve, reject) => {

Callers

nothing calls this directly

Calls 4

getActiveCDSessionMethod · 0.80
FindSessionMethod · 0.80
FindSessionByIdMethod · 0.80
customRequestMethod · 0.65

Tested by

no test coverage detected