()
| 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) => { |
nothing calls this directly
no test coverage detected