(useParent)
| 474 | } |
| 475 | |
| 476 | private getTCPPorts(useParent): Thenable<void> { |
| 477 | return new Promise((resolve, reject) => { |
| 478 | const startPort = 50000; |
| 479 | if (useParent) { |
| 480 | this.ports = this.args.pvtPorts = this.args.pvtParent.pvtPorts; |
| 481 | this.serverController.setPorts(this.ports); |
| 482 | if (this.args.showDevDebugOutput) { |
| 483 | this.handleMsg('log', JSON.stringify({configFromParent: this.args.pvtMyConfigFromParent}, undefined, 4) + '\n'); |
| 484 | } |
| 485 | return resolve(); |
| 486 | } |
| 487 | const totalPortsNeeded = this.calculatePortsNeeded(); |
| 488 | const portFinderOpts = { min: startPort, max: 52000, retrieve: totalPortsNeeded, consecutive: true }; |
| 489 | TcpPortScanner.findFreePorts(portFinderOpts, GDBServer.LOCALHOST).then((ports) => { |
| 490 | this.createPortsMap(ports); |
| 491 | this.serverController.setPorts(this.ports); |
| 492 | resolve(); |
| 493 | }, (e) => { |
| 494 | reject(e); |
| 495 | }); |
| 496 | }); |
| 497 | } |
| 498 | |
| 499 | private processLaunchAttachRequest(response: DebugProtocol.LaunchResponse, attach: boolean): Promise<void> { |
| 500 | return new Promise<void>((resolve) => { |
no test coverage detected