(cwd: string, executable: string, target: string, autorun: string[])
| 257 | } |
| 258 | |
| 259 | connect(cwd: string, executable: string, target: string, autorun: string[]): Thenable<any> { |
| 260 | return new Promise((resolve, reject) => { |
| 261 | let args = []; |
| 262 | if (executable && !path.isAbsolute(executable)) |
| 263 | executable = path.join(cwd, executable); |
| 264 | args = this.preargs.concat(this.extraargs || []); |
| 265 | if (executable) |
| 266 | args = args.concat([executable]); |
| 267 | this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv }); |
| 268 | this.process.stdout.on("data", this.stdout.bind(this)); |
| 269 | this.process.stderr.on("data", this.stderr.bind(this)); |
| 270 | this.process.on("exit", (() => { this.emit("quit"); }).bind(this)); |
| 271 | this.process.on("error", ((err) => { this.emit("launcherror", err); }).bind(this)); |
| 272 | const promises = this.initCommands(target, cwd, true); |
| 273 | promises.push(this.sendCommand("target-select remote " + target)); |
| 274 | promises.push(...autorun.map(value => { return this.sendUserInput(value); })); |
| 275 | Promise.all(promises).then(() => { |
| 276 | this.emit("debug-ready"); |
| 277 | resolve(undefined); |
| 278 | }, reject); |
| 279 | }); |
| 280 | } |
| 281 | |
| 282 | stdout(data) { |
| 283 | if (trace) |
nothing calls this directly
no test coverage detected