Merge pull request #16 from bbenoist/feature/ssh-bootstrap
Add an option to execute additional commands before GDB when using SSH
This commit is contained in:
commit
517870e1b8
4 changed files with 15 additions and 2 deletions
|
|
@ -84,7 +84,9 @@ request.
|
||||||
"password": "password123",
|
"password": "password123",
|
||||||
"user": "remoteUser",
|
"user": "remoteUser",
|
||||||
"x11host": "localhost",
|
"x11host": "localhost",
|
||||||
"x11port": 6000
|
"x11port": 6000,
|
||||||
|
// Optional, content will be executed on the SSH host before the debugger call.
|
||||||
|
"bootstrap": "source /home/remoteUser/some-env"
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
@ -95,4 +97,8 @@ For X11 forwarding to work you first need to enable it in your Display Manager a
|
||||||
connections. To allow connections you can either add an entry for applications or run `xhost +`
|
connections. To allow connections you can either add an entry for applications or run `xhost +`
|
||||||
in the console while you are debugging and turn it off again when you are done using `xhost -`.
|
in the console while you are debugging and turn it off again when you are done using `xhost -`.
|
||||||
|
|
||||||
|
Because some builds requires one or more environment files to be sourced before running any
|
||||||
|
command, you can use the `ssh.bootstrap` option to add some extra commands which will be prepended
|
||||||
|
to the debugger call (using `&&` to join both).
|
||||||
|
|
||||||
## [Issues](https://github.com/WebFreak001/code-debug)
|
## [Issues](https://github.com/WebFreak001/code-debug)
|
||||||
|
|
@ -111,6 +111,10 @@
|
||||||
"type": "number",
|
"type": "number",
|
||||||
"description": "Screen to start the application on the remote side",
|
"description": "Screen to start the application on the remote side",
|
||||||
"default": 0
|
"default": 0
|
||||||
|
},
|
||||||
|
"bootstrap": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Content will be executed on the SSH host before the debugger call."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ export interface SSHArguments {
|
||||||
remotex11screen: number;
|
remotex11screen: number;
|
||||||
x11port: number;
|
x11port: number;
|
||||||
x11host: string;
|
x11host: string;
|
||||||
|
bootstrap: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IBackend {
|
export interface IBackend {
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,9 @@ export class MI2 extends EventEmitter implements IBackend {
|
||||||
screen: args.remotex11screen
|
screen: args.remotex11screen
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
this.sshConn.exec(this.application + " " + this.preargs.join(" "), execArgs, (err, stream) => {
|
let sshCMD = this.application + " " + this.preargs.join(" ");
|
||||||
|
if (args.bootstrap) sshCMD = args.bootstrap + " && " + sshCMD;
|
||||||
|
this.sshConn.exec(sshCMD, execArgs, (err, stream) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
this.log("stderr", "Could not run " + this.application + " over ssh!");
|
this.log("stderr", "Could not run " + this.application + " over ssh!");
|
||||||
this.log("stderr", err.toString());
|
this.log("stderr", err.toString());
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue