Made target path absolute when passing to gdb (should fix #22)
This commit is contained in:
parent
d3353231c8
commit
2aff091374
2 changed files with 19 additions and 3 deletions
|
|
@ -137,7 +137,7 @@ export class MI2 extends EventEmitter implements IBackend {
|
|||
this.emit("quit");
|
||||
this.sshConn.end();
|
||||
}).bind(this));
|
||||
let promises = this.initCommands(target, cwd);
|
||||
let promises = this.initCommands(target, cwd, true);
|
||||
promises.push(this.sendCommand("environment-cd \"" + escape(cwd) + "\""));
|
||||
if (procArgs && procArgs.length)
|
||||
promises.push(this.sendCommand("exec-arguments " + procArgs));
|
||||
|
|
@ -155,7 +155,15 @@ export class MI2 extends EventEmitter implements IBackend {
|
|||
});
|
||||
}
|
||||
|
||||
protected initCommands(target: string, cwd: string) {
|
||||
protected initCommands(target: string, cwd: string, ssh: boolean = false) {
|
||||
if (ssh) {
|
||||
if (!path.isAbsolute(target))
|
||||
target = path.join(cwd, target);
|
||||
}
|
||||
else {
|
||||
if (!nativePath.isAbsolute(target))
|
||||
target = nativePath.join(cwd, target);
|
||||
}
|
||||
return [
|
||||
this.sendCommand("gdb-set target-async on"),
|
||||
this.sendCommand("environment-directory \"" + escape(cwd) + "\""),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue