implement debugger_args option

This commit is contained in:
Mrmaxmeier 2016-12-11 21:24:55 +01:00
commit c831c4d4e4
4 changed files with 15 additions and 8 deletions

View file

@ -27,7 +27,7 @@ function couldBeOutput(line: string) {
const trace = false;
export class MI2 extends EventEmitter implements IBackend {
constructor(public application: string, public preargs: string[]) {
constructor(public application: string, public preargs: string[], public extraargs: string[]) {
super();
}
@ -36,7 +36,8 @@ export class MI2 extends EventEmitter implements IBackend {
target = nativePath.join(cwd, target);
return new Promise((resolve, reject) => {
this.isSSH = false;
this.process = ChildProcess.spawn(this.application, this.preargs, { cwd: cwd });
let args = this.preargs.concat(this.extraargs || []);
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd });
this.process.stdout.on("data", this.stdout.bind(this));
this.process.stderr.on("data", this.stderr.bind(this));
this.process.on("exit", (() => { this.emit("quit"); }).bind(this));