Added showDevDebugOutput option to debug GDB calls
This commit is contained in:
parent
e7c15f0d71
commit
640abf822b
5 changed files with 51 additions and 7 deletions
42
package.json
42
package.json
|
|
@ -79,7 +79,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all GDB calls to console",
|
"description": "Prints all GDB calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all GDB responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"autorun": {
|
"autorun": {
|
||||||
|
|
@ -165,7 +170,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all GDB calls to console",
|
"description": "Prints all GDB calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all GDB responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"executable": {
|
"executable": {
|
||||||
|
|
@ -257,7 +267,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all lldb calls to console",
|
"description": "Prints all lldb calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all lldb responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"autorun": {
|
"autorun": {
|
||||||
|
|
@ -338,7 +353,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all LLDB calls to console",
|
"description": "Prints all LLDB calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all LLDB responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"executable": {
|
"executable": {
|
||||||
|
|
@ -409,7 +429,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all mago calls to console",
|
"description": "Prints all mago calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all mago responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"autorun": {
|
"autorun": {
|
||||||
|
|
@ -430,7 +455,12 @@
|
||||||
},
|
},
|
||||||
"printCalls": {
|
"printCalls": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Prints all mago calls to console",
|
"description": "Prints all mago calls to the console",
|
||||||
|
"default": false
|
||||||
|
},
|
||||||
|
"showDevDebugOutput": {
|
||||||
|
"type": "boolean",
|
||||||
|
"description": "Prints all mago responses to the console",
|
||||||
"default": false
|
"default": false
|
||||||
},
|
},
|
||||||
"executable": {
|
"executable": {
|
||||||
|
|
|
||||||
|
|
@ -275,7 +275,8 @@ export class MI2 extends EventEmitter implements IBackend {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let parsed = parseMI(line);
|
let parsed = parseMI(line);
|
||||||
//this.log("log", JSON.stringify(parsed));
|
if (this.debugOutput)
|
||||||
|
this.log("log", "GDB -> App: " + JSON.stringify(parsed));
|
||||||
let handled = false;
|
let handled = false;
|
||||||
if (parsed.token !== undefined) {
|
if (parsed.token !== undefined) {
|
||||||
if (this.handlers[parsed.token]) {
|
if (this.handlers[parsed.token]) {
|
||||||
|
|
@ -617,6 +618,7 @@ export class MI2 extends EventEmitter implements IBackend {
|
||||||
}
|
}
|
||||||
|
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
debugOutput: boolean;
|
||||||
protected isSSH: boolean;
|
protected isSSH: boolean;
|
||||||
protected sshReady: boolean;
|
protected sshReady: boolean;
|
||||||
protected currentToken: number = 1;
|
protected currentToken: number = 1;
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ export interface LaunchRequestArguments {
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
ssh: SSHArguments;
|
ssh: SSHArguments;
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttachRequestArguments {
|
export interface AttachRequestArguments {
|
||||||
|
|
@ -23,6 +24,7 @@ export interface AttachRequestArguments {
|
||||||
remote: boolean;
|
remote: boolean;
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class GDBDebugSession extends MI2DebugSession {
|
class GDBDebugSession extends MI2DebugSession {
|
||||||
|
|
@ -47,6 +49,7 @@ class GDBDebugSession extends MI2DebugSession {
|
||||||
this.crashed = false;
|
this.crashed = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
if (args.ssh !== undefined) {
|
if (args.ssh !== undefined) {
|
||||||
if (args.ssh.forwardX11 === undefined)
|
if (args.ssh.forwardX11 === undefined)
|
||||||
args.ssh.forwardX11 = true;
|
args.ssh.forwardX11 = true;
|
||||||
|
|
@ -113,6 +116,7 @@ class GDBDebugSession extends MI2DebugSession {
|
||||||
this.isSSH = false;
|
this.isSSH = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
if (args.remote) {
|
if (args.remote) {
|
||||||
this.miDebugger.connect(args.cwd, args.executable, args.target).then(() => {
|
this.miDebugger.connect(args.cwd, args.executable, args.target).then(() => {
|
||||||
if (args.autorun)
|
if (args.autorun)
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ export interface LaunchRequestArguments {
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
ssh: SSHArguments;
|
ssh: SSHArguments;
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttachRequestArguments {
|
export interface AttachRequestArguments {
|
||||||
|
|
@ -21,6 +22,7 @@ export interface AttachRequestArguments {
|
||||||
executable: string;
|
executable: string;
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class LLDBDebugSession extends MI2DebugSession {
|
class LLDBDebugSession extends MI2DebugSession {
|
||||||
|
|
@ -43,6 +45,7 @@ class LLDBDebugSession extends MI2DebugSession {
|
||||||
this.crashed = false;
|
this.crashed = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
if (args.ssh !== undefined) {
|
if (args.ssh !== undefined) {
|
||||||
if (args.ssh.forwardX11 === undefined)
|
if (args.ssh.forwardX11 === undefined)
|
||||||
args.ssh.forwardX11 = true;
|
args.ssh.forwardX11 = true;
|
||||||
|
|
@ -101,6 +104,7 @@ class LLDBDebugSession extends MI2DebugSession {
|
||||||
this.isSSH = false;
|
this.isSSH = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
this.miDebugger.attach(args.cwd, args.executable, args.target).then(() => {
|
this.miDebugger.attach(args.cwd, args.executable, args.target).then(() => {
|
||||||
if (args.autorun)
|
if (args.autorun)
|
||||||
args.autorun.forEach(command => {
|
args.autorun.forEach(command => {
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export interface LaunchRequestArguments {
|
||||||
arguments: string;
|
arguments: string;
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttachRequestArguments {
|
export interface AttachRequestArguments {
|
||||||
|
|
@ -20,6 +21,7 @@ export interface AttachRequestArguments {
|
||||||
executable: string;
|
executable: string;
|
||||||
autorun: string[];
|
autorun: string[];
|
||||||
printCalls: boolean;
|
printCalls: boolean;
|
||||||
|
showDevDebugOutput: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MagoDebugSession extends MI2DebugSession {
|
class MagoDebugSession extends MI2DebugSession {
|
||||||
|
|
@ -50,6 +52,7 @@ class MagoDebugSession extends MI2DebugSession {
|
||||||
this.crashed = false;
|
this.crashed = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
this.miDebugger.load(args.cwd, args.target, args.arguments, undefined).then(() => {
|
this.miDebugger.load(args.cwd, args.target, args.arguments, undefined).then(() => {
|
||||||
if (args.autorun)
|
if (args.autorun)
|
||||||
args.autorun.forEach(command => {
|
args.autorun.forEach(command => {
|
||||||
|
|
@ -76,6 +79,7 @@ class MagoDebugSession extends MI2DebugSession {
|
||||||
this.isSSH = false;
|
this.isSSH = false;
|
||||||
this.debugReady = false;
|
this.debugReady = false;
|
||||||
this.miDebugger.printCalls = !!args.printCalls;
|
this.miDebugger.printCalls = !!args.printCalls;
|
||||||
|
this.miDebugger.debugOutput = !!args.showDevDebugOutput;
|
||||||
this.miDebugger.attach(args.cwd, args.executable, args.target).then(() => {
|
this.miDebugger.attach(args.cwd, args.executable, args.target).then(() => {
|
||||||
if (args.autorun)
|
if (args.autorun)
|
||||||
args.autorun.forEach(command => {
|
args.autorun.forEach(command => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue