Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
sudo: false

language: node_js
node_js:
- stable
os:
- osx
- linux
Expand Down
30 changes: 30 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@
"description": "Path to the gdb executable or the command if in PATH",
"default": "gdb"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to GDB",
"default": []
},
"printCalls": {
"type": "boolean",
"description": "Prints all GDB calls to the console",
Expand Down Expand Up @@ -201,6 +206,11 @@
"description": "Path to the gdb executable or the command if in PATH",
"default": "gdb"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to GDB",
"default": []
},
"cwd": {
"type": "string",
"description": "Path of project",
Expand Down Expand Up @@ -284,6 +294,11 @@
"description": "Path to the lldb-mi executable or the command if in PATH",
"default": "lldb-mi"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to LLDB",
"default": []
},
"printCalls": {
"type": "boolean",
"description": "Prints all lldb calls to the console",
Expand Down Expand Up @@ -389,6 +404,11 @@
"description": "Path to the lldb-mi executable or the command if in PATH",
"default": "lldb-mi"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to LLDB",
"default": []
},
"cwd": {
"type": "string",
"description": "Path of project",
Expand Down Expand Up @@ -450,6 +470,11 @@
"description": "Path to the mago-mi executable or the command if in PATH",
"default": "mago-mi"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to mago",
"default": []
},
"printCalls": {
"type": "boolean",
"description": "Prints all mago calls to the console",
Expand Down Expand Up @@ -495,6 +520,11 @@
"description": "Path to the mago-mi executable or the command if in PATH",
"default": "mago-mi"
},
"debugger_args": {
"type": "array",
"description": "Additional arguments to pass to mago",
"default": []
},
"cwd": {
"type": "string",
"description": "Path of project",
Expand Down
5 changes: 3 additions & 2 deletions src/backend/mi2/mi2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ function couldBeOutput(line: string) {
const trace = false;

export class MI2 extends EventEmitter implements IBackend {
constructor(public application: string, public preargs: string[]) {
constructor(public application: string, public preargs: string[], public extraargs: string[]) {
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@WebFreak001 I've updated MI2 to accept the additional arguments.

super();
}

Expand All @@ -36,7 +36,8 @@ export class MI2 extends EventEmitter implements IBackend {
target = nativePath.join(cwd, target);
return new Promise((resolve, reject) => {
this.isSSH = false;
this.process = ChildProcess.spawn(this.application, this.preargs, { cwd: cwd });
let args = this.preargs.concat(this.extraargs || []);
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));
Expand Down
6 changes: 4 additions & 2 deletions src/gdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface LaunchRequestArguments {
cwd: string;
target: string;
gdbpath: string;
debugger_args: string[];
arguments: string;
terminal: string;
autorun: string[];
Expand All @@ -20,6 +21,7 @@ export interface AttachRequestArguments {
cwd: string;
target: string;
gdbpath: string;
debugger_args: string[];
executable: string;
remote: boolean;
autorun: string[];
Expand All @@ -40,7 +42,7 @@ class GDBDebugSession extends MI2DebugSession {
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"]);
this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = false;
Expand Down Expand Up @@ -109,7 +111,7 @@ class GDBDebugSession extends MI2DebugSession {
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"]);
this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = !args.remote;
Expand Down
6 changes: 4 additions & 2 deletions src/lldb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface LaunchRequestArguments {
cwd: string;
target: string;
lldbmipath: string;
debugger_args: string[];
arguments: string;
autorun: string[];
ssh: SSHArguments;
Expand All @@ -19,6 +20,7 @@ export interface AttachRequestArguments {
cwd: string;
target: string;
lldbmipath: string;
debugger_args: string[];
executable: string;
autorun: string[];
printCalls: boolean;
Expand All @@ -36,7 +38,7 @@ class LLDBDebugSession extends MI2DebugSession {
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", []);
this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", [], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = false;
Expand Down Expand Up @@ -97,7 +99,7 @@ class LLDBDebugSession extends MI2DebugSession {
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", []);
this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", [], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = true;
Expand Down
6 changes: 4 additions & 2 deletions src/mago.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface LaunchRequestArguments {
cwd: string;
target: string;
magomipath: string;
debugger_args: string[];
arguments: string;
autorun: string[];
printCalls: boolean;
Expand All @@ -18,6 +19,7 @@ export interface AttachRequestArguments {
cwd: string;
target: string;
magomipath: string;
debugger_args: string[];
executable: string;
autorun: string[];
printCalls: boolean;
Expand All @@ -43,7 +45,7 @@ class MagoDebugSession extends MI2DebugSession {
}

protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void {
this.miDebugger = new MI2_Mago(args.magomipath || "mago-mi", ["-q"]);
this.miDebugger = new MI2_Mago(args.magomipath || "mago-mi", ["-q"], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = false;
Expand Down Expand Up @@ -72,7 +74,7 @@ class MagoDebugSession extends MI2DebugSession {
}

protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void {
this.miDebugger = new MI2_Mago(args.magomipath || "mago-mi", []);
this.miDebugger = new MI2_Mago(args.magomipath || "mago-mi", [], args.debugger_args);
this.initDebugger();
this.quit = false;
this.attached = true;
Expand Down