diff --git a/debug_attributes.md b/debug_attributes.md index 0b58aee9..fd7b3bbb 100644 --- a/debug_attributes.md +++ b/debug_attributes.md @@ -32,6 +32,7 @@ If the type is marked as `{...}` it means that it is a complex item can have mul | debuggerArgs | array | Both | Additional arguments to pass to GDB command line | | device | string | Both | Target Device Identifier | | executable | string | Both | Path of executable for symbols and program information. See also `loadFiles`, `symbolFiles` | +| gdbHost | string | Both | Host for the GDB server connection (defaults to localhost). Only used for servertype jlink. | | gdbInterruptMode | string | Both | Whether GDB shall be interrupted using "exec-interrupt" (default) or by signaling "SIGINT" | | gdbPath | string | Both | This setting can be used to override the GDB path user/workspace setting for a particular launch configuration. This should be the full pathname to the executable (or name of the executable if it is in your PATH). Note that other toolchain executables with the configured prefix must still be available. | | gdbTarget | string | Both | For externally (servertype = "external") controlled GDB Servers you must specify the GDB target to connect to. This can either be a "hostname:port" combination or path to a serial port | diff --git a/package.json b/package.json index d9e5c93c..5ac8a945 100644 --- a/package.json +++ b/package.json @@ -1618,6 +1618,11 @@ "description": "J-Link script file - optional input file for customizing J-Link actions.", "type": "string" }, + "gdbHost": { + "default": null, + "description": "Host for the GDB server connection (defaults to localhost). Only used for servertype jlink.", + "type": "string" + }, "openOCDLaunchCommands": { "default": [], "description": "OpenOCD command(s) after configuration files are loaded (-c options)", @@ -2843,6 +2848,11 @@ "description": "J-Link script file - optional input file for customizing J-Link actions.", "type": "string" }, + "gdbHost": { + "default": null, + "description": "Host for the GDB server connection (defaults to localhost). Only used for servertype jlink.", + "type": "string" + }, "openOCDLaunchCommands": { "default": [], "description": "OpenOCD command(s) after configuration files are loaded (-c options)", diff --git a/src/common.ts b/src/common.ts index 86043f09..c8604eb0 100644 --- a/src/common.ts +++ b/src/common.ts @@ -335,6 +335,7 @@ export interface ConfigurationArguments extends DebugProtocol.LaunchRequestArgum ipAddress: string; serialNumber: string; jlinkscript: string; + gdbHost: string; // OpenOCD Specific configFiles: string[]; diff --git a/src/jlink.ts b/src/jlink.ts index 356ed53e..36fbc612 100644 --- a/src/jlink.ts +++ b/src/jlink.ts @@ -33,9 +33,9 @@ export class JLinkServerController extends EventEmitter implements GDBServerCont public initCommands(): string[] { const gdbport = this.ports[createPortName(this.args.targetProcessor)]; - + const host = this.args.gdbHost || 'localhost'; return [ - `target-select extended-remote localhost:${gdbport}` + `target-select extended-remote ${host}:${gdbport}` ]; }