Added option to print calls from GDB

This commit is contained in:
WebFreak001 2016-02-10 20:54:57 +01:00
commit 544c3a488b
3 changed files with 17 additions and 0 deletions

View file

@ -476,6 +476,8 @@ export class MI2 extends EventEmitter implements IBackend {
}
sendRaw(raw: string) {
if (this.printCalls)
this.log("log", raw);
if (this.isSSH)
this.stream.write(raw + "\n");
else
@ -502,6 +504,7 @@ export class MI2 extends EventEmitter implements IBackend {
return this.isSSH ? this.sshReady : !!this.process;
}
printCalls: boolean;
private isSSH: boolean;
private sshReady: boolean;
private currentToken: number = 1;

View file

@ -15,6 +15,7 @@ export interface LaunchRequestArguments {
target: string;
autorun: string[];
ssh: SSHArguments;
printCalls: boolean;
}
export interface AttachRequestArguments {
@ -23,6 +24,7 @@ export interface AttachRequestArguments {
executable: string;
remote: boolean;
autorun: string[];
printCalls: boolean;
}
class MI2DebugSession extends DebugSession {
@ -92,6 +94,7 @@ class MI2DebugSession extends DebugSession {
this.attached = false;
this.needContinue = false;
this.isSSH = false;
this.gdbDebugger.printCalls = !!args.printCalls;
if (args.ssh !== undefined) {
if (args.ssh.forwardX11 === undefined)
args.ssh.forwardX11 = true;
@ -134,6 +137,7 @@ class MI2DebugSession extends DebugSession {
this.attached = !args.remote;
this.needContinue = true;
this.isSSH = false;
this.gdbDebugger.printCalls = !!args.printCalls;
if (args.remote) {
this.gdbDebugger.connect(args.cwd, args.executable, args.target).then(() => {
if (args.autorun)