(e: vscode.DebugSessionCustomEvent, tcpPort: string, channel: number)
| 792 | // The returned value is a connection source. It may still be in disconnected |
| 793 | // state. |
| 794 | private createRTTSource(e: vscode.DebugSessionCustomEvent, tcpPort: string, channel: number): Promise<SocketRTTSource> { |
| 795 | const mySession = CDebugSession.GetSession(e.session); |
| 796 | return new Promise((resolve, reject) => { |
| 797 | let src = mySession.rttPortMap[channel]; |
| 798 | if (src) { |
| 799 | resolve(src); |
| 800 | return; |
| 801 | } |
| 802 | if (mySession.config.servertype === 'jlink') { |
| 803 | src = new JLinkSocketRTTSource(tcpPort, channel); |
| 804 | } else { |
| 805 | src = new SocketRTTSource(tcpPort, channel); |
| 806 | } |
| 807 | mySession.rttPortMap[channel] = src; // Yes, we put this in the list even if start() can fail |
| 808 | resolve(src); // Yes, it is okay to resolve it even though the connection isn't made yet |
| 809 | src.start().then(() => { |
| 810 | mySession.session.customRequest('rtt-poll'); |
| 811 | }).catch((e) => { |
| 812 | vscode.window.showErrorMessage(`Could not connect to RTT TCP port ${tcpPort} ${e}`); |
| 813 | // reject(e); |
| 814 | }); |
| 815 | }); |
| 816 | } |
| 817 | |
| 818 | private cleanupRTTTerminals() { |
| 819 | this.rttTerminals = this.rttTerminals.filter((t) => { |
no test coverage detected