views:

251

answers:

2

Question:

  • Is it possible to debug, when the target is on a remote host?

Example:

 # ddd --debugger /usr/bin/bashdb <sript-name> (on remote host)
+1  A: 

What you can do is ssh into the remote host, and set the $DISPLAY variable to point to your local host, so that ddd's GUI opens there:

First lookup your current $DISPLAY:

mylocalhost:~> echo $DISPLAY
mylocalhost:1

Assuming that your current X-client is on port 1.

Now setup the remote $DISPLAY to point to your local machine:

mylocalhost:~> ssh remotehost
remotehost:~> setenv DISPLAY mylocalhost:1    

Now fire up ddd:

remotehost:~> ddd <whatever parameters you want>

Note that you may have to open up your local X-client to remote connections before you do this. This is how:

mylocalhost:~> xhost +
Nathan Fellman
this would be running *ddd* remotely, as opposed to running *ddd* locally and debugging a remote program. (just to clarify what this does. it may be a suitable alternative for the OP's purpose, whatever that may be.)
quack quixote
ssh can also be set up to tunnel the X connection securely back to your display server. You can do this on the command line by specifying `-o ForwardX11=yes`
R Samuel Klatchko
+1  A: 

Use gdbserver on the target (remote) machine as explained there. Then follow the config steps for gdb remote debugging (look up the gdb doc), typing the commands in the ddd console window (it's a pass through to the gdb prompt).

This could be something like this (if your link to the target were an USB to serial link, for instance):

(gdb) set remotebaud 115200
(gdb) target remote /dev/ttyUSB0

or

(gdb) target remote the-target:2345

to debug the gdbserver on IP the-target,using TCP port 2345.

filofel