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.emit("quit");
|
||||||
this.sshConn.end();
|
this.sshConn.end();
|
||||||
}).bind(this));
|
}).bind(this));
|
||||||
let promises = this.initCommands(target, cwd);
|
let promises = this.initCommands(target, cwd, true);
|
||||||
promises.push(this.sendCommand("environment-cd \"" + escape(cwd) + "\""));
|
promises.push(this.sendCommand("environment-cd \"" + escape(cwd) + "\""));
|
||||||
if (procArgs && procArgs.length)
|
if (procArgs && procArgs.length)
|
||||||
promises.push(this.sendCommand("exec-arguments " + procArgs));
|
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 [
|
return [
|
||||||
this.sendCommand("gdb-set target-async on"),
|
this.sendCommand("gdb-set target-async on"),
|
||||||
this.sendCommand("environment-directory \"" + escape(cwd) + "\""),
|
this.sendCommand("environment-directory \"" + escape(cwd) + "\""),
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,15 @@ import * as nativePath from "path"
|
||||||
let path = posix;
|
let path = posix;
|
||||||
|
|
||||||
export class MI2_LLDB extends MI2 {
|
export class MI2_LLDB extends MI2 {
|
||||||
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 [
|
return [
|
||||||
this.sendCommand("gdb-set target-async on"),
|
this.sendCommand("gdb-set target-async on"),
|
||||||
this.sendCommand("file-exec-and-symbols \"" + escape(target) + "\"")
|
this.sendCommand("file-exec-and-symbols \"" + escape(target) + "\"")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue