diff --git a/package.json b/package.json index 9f3dc0a..a2df5cc 100644 --- a/package.json +++ b/package.json @@ -60,6 +60,11 @@ "type": "string", "description": "Path of project" }, + "gdbpath": { + "type": "string", + "description": "Path to the gdb executable or the command if in PATH", + "default": "gdb" + }, "printCalls": { "type": "boolean", "description": "Prints all GDB calls to console", @@ -155,6 +160,11 @@ "type": "string", "description": "Path of executable for debugging symbols" }, + "gdbpath": { + "type": "string", + "description": "Path to the gdb executable or the command if in PATH", + "default": "gdb" + }, "cwd": { "type": "string", "description": "Path of project", @@ -228,6 +238,11 @@ "type": "string", "description": "Path of project" }, + "lldbmipath": { + "type": "string", + "description": "Path to the lldb-mi executable or the command if in PATH", + "default": "lldb-mi" + }, "printCalls": { "type": "boolean", "description": "Prints all lldb calls to console", @@ -318,6 +333,11 @@ "type": "string", "description": "Path of executable for debugging symbols" }, + "lldbmipath": { + "type": "string", + "description": "Path to the lldb-mi executable or the command if in PATH", + "default": "lldb-mi" + }, "cwd": { "type": "string", "description": "Path of project", diff --git a/src/gdb.ts b/src/gdb.ts index ecfa97d..b588234 100644 --- a/src/gdb.ts +++ b/src/gdb.ts @@ -7,6 +7,7 @@ import { SSHArguments } from './backend/backend'; export interface LaunchRequestArguments { cwd: string; target: string; + gdbpath: string; arguments: string; terminal: string; autorun: string[]; @@ -17,6 +18,7 @@ export interface LaunchRequestArguments { export interface AttachRequestArguments { cwd: string; target: string; + gdbpath: string; executable: string; remote: boolean; autorun: string[]; @@ -30,11 +32,11 @@ class GDBDebugSession extends MI2DebugSession { response.body.supportsFunctionBreakpoints = true; response.body.supportsEvaluateForHovers = true; this.sendResponse(response); - this.miDebugger = new MI2("gdb", ["-q", "--interpreter=mi2"]); - this.initDebugger(); } protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { + this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"]); + this.initDebugger(); this.quit = false; this.attached = false; this.needContinue = false; @@ -93,6 +95,8 @@ class GDBDebugSession extends MI2DebugSession { } protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void { + this.miDebugger = new MI2(args.gdbpath || "gdb", ["-q", "--interpreter=mi2"]); + this.initDebugger(); this.quit = false; this.attached = !args.remote; this.needContinue = true; diff --git a/src/lldb.ts b/src/lldb.ts index 8190dfc..9960737 100644 --- a/src/lldb.ts +++ b/src/lldb.ts @@ -7,6 +7,7 @@ import { SSHArguments } from './backend/backend'; export interface LaunchRequestArguments { cwd: string; target: string; + lldbmipath: string; arguments: string; autorun: string[]; ssh: SSHArguments; @@ -16,6 +17,7 @@ export interface LaunchRequestArguments { export interface AttachRequestArguments { cwd: string; target: string; + lldbmipath: string; executable: string; autorun: string[]; printCalls: boolean; @@ -28,11 +30,11 @@ class LLDBDebugSession extends MI2DebugSession { response.body.supportsFunctionBreakpoints = true; response.body.supportsEvaluateForHovers = true; this.sendResponse(response); - this.miDebugger = new MI2_LLDB("lldb-mi", []); - this.initDebugger(); } protected launchRequest(response: DebugProtocol.LaunchResponse, args: LaunchRequestArguments): void { + this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", []); + this.initDebugger(); this.quit = false; this.attached = false; this.needContinue = false; @@ -91,6 +93,8 @@ class LLDBDebugSession extends MI2DebugSession { } protected attachRequest(response: DebugProtocol.AttachResponse, args: AttachRequestArguments): void { + this.miDebugger = new MI2_LLDB(args.lldbmipath || "lldb-mi", []); + this.initDebugger(); this.quit = false; this.attached = true; this.needContinue = true;