This commit is contained in:
WebFreak001 2017-04-14 18:26:40 +02:00
commit a21e2e65af
6 changed files with 47 additions and 11 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[], public extraargs: string[]) {
constructor(public application: string, public preargs: string[], public extraargs: string[], public procEnv: any) {
super();
}
@ -37,7 +37,7 @@ export class MI2 extends EventEmitter implements IBackend {
return new Promise((resolve, reject) => {
this.isSSH = false;
let args = this.preargs.concat(this.extraargs || []);
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd });
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv });
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));
@ -193,7 +193,7 @@ export class MI2 extends EventEmitter implements IBackend {
args = this.preargs;
} else
args = args.concat([executable, target], this.preargs);
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd });
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv });
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));
@ -222,7 +222,7 @@ export class MI2 extends EventEmitter implements IBackend {
args = args.concat([executable], this.preargs);
else
args = this.preargs;
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd });
this.process = ChildProcess.spawn(this.application, args, { cwd: cwd, env: this.procEnv });
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));

View file

@ -25,7 +25,7 @@ export class MI2_LLDB extends MI2 {
attach(cwd: string, executable: string, target: string): Thenable<any> {
return new Promise((resolve, reject) => {
this.process = ChildProcess.spawn(this.application, this.preargs, { cwd: cwd });
this.process = ChildProcess.spawn(this.application, this.preargs, { cwd: cwd, env: this.procEnv });
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));