Added special commands for extended-remote fix #91
This commit is contained in:
parent
3738f4f03c
commit
318ece44cf
2 changed files with 31 additions and 3 deletions
|
|
@ -186,15 +186,25 @@ export class MI2 extends EventEmitter implements IBackend {
|
|||
executable = nativePath.join(cwd, executable);
|
||||
if (!executable)
|
||||
executable = "-p";
|
||||
args = args.concat([executable, target], this.preargs);
|
||||
var isExtendedRemote = false;
|
||||
if (target.startsWith("extended-remote")) {
|
||||
isExtendedRemote = true;
|
||||
args = this.preargs;
|
||||
} else
|
||||
args = args.concat([executable, target], this.preargs);
|
||||
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));
|
||||
Promise.all([
|
||||
var commands = [
|
||||
this.sendCommand("gdb-set target-async on"),
|
||||
this.sendCommand("environment-directory \"" + escape(cwd) + "\"")
|
||||
]).then(() => {
|
||||
];
|
||||
if (isExtendedRemote) {
|
||||
commands.push(this.sendCommand("target-select " + target));
|
||||
commands.push(this.sendCommand("file-symbol-file \"" + escape(executable) + "\""));
|
||||
}
|
||||
Promise.all(commands).then(() => {
|
||||
this.emit("debug-ready")
|
||||
resolve();
|
||||
}, reject);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue