Added remote debugging via SSH (fix #11)

This commit is contained in:
WebFreak001 2016-02-09 21:51:44 +01:00
commit 0ec1a4e8cf
5 changed files with 382 additions and 87 deletions

View file

@ -66,4 +66,33 @@ port and optionally hostname in `target`.
This will attach to the running process managed by gdbserver on localhost:2345. You might
need to hit the start button in the debug bar at the top first to start the program.
### Using ssh for remote debugging
Debugging using ssh automatically converts all paths between client & server and also optionally
redirects X11 output from the server to the client. Simply add a `ssh` object in your `launch`
request.
```
"request": "launch",
"target": "./executable",
"cwd": "${workspaceRoot}",
"ssh": {
"forwardX11": true,
"host": "192.168.178.57",
"cwd": "/home/remoteUser/project/",
"keyfile": "/path/to/.ssh/key", // OR
"password": "password123",
"user": "remoteUser",
"x11host": "localhost",
"x11port": 6000
}
```
`cwd` will be used to trim off local paths and `ssh.cwd` will map them to the server. This is
required for basically everything except watched variables or user commands to work.
For X11 forwarding to work you first need to enable it in your Display Manager and allow the
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 -`.
## [Issues](https://github.com/WebFreak001/code-debug)