Fixed entering MI commands into the debug console

This commit is contained in:
WebFreak001 2016-07-10 17:33:25 +02:00
commit ef1f4782b4
2 changed files with 17 additions and 11 deletions

View file

@ -573,15 +573,13 @@ export class MI2 extends EventEmitter implements IBackend {
} }
sendUserInput(command: string): Thenable<any> { sendUserInput(command: string): Thenable<any> {
return new Promise((resolve, reject) => { if (command.startsWith("-")) {
if (command.startsWith("-")) { return this.sendCommand(command.substr(1));
this.sendCommand(command.substr(1)).then(resolve, reject); }
} else {
else { this.sendRaw(command);
this.sendRaw(command); return Promise.resolve(undefined);
resolve(undefined); }
}
});
} }
sendRaw(raw: string) { sendRaw(raw: string) {

View file

@ -348,8 +348,16 @@ export class MI2DebugSession extends DebugSession {
}); });
else { else {
this.miDebugger.sendUserInput(args.expression).then(output => { this.miDebugger.sendUserInput(args.expression).then(output => {
if (output) if (typeof output == "undefined")
response.body.result = JSON.stringify(output); response.body = {
result: "",
variablesReference: 0
};
else
response.body = {
result: JSON.stringify(output),
variablesReference: 0
};
this.sendResponse(response); this.sendResponse(response);
}, msg => { }, msg => {
this.sendErrorResponse(response, 8, msg.toString()); this.sendErrorResponse(response, 8, msg.toString());