11

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)
Gerhard
  • 6,850
  • 8
  • 51
  • 81
Aaron
  • 2,823
  • 9
  • 44
  • 57

3 Answers3

6

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
  • 1,358
  • 7
  • 11
3

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
  • 122,701
  • 101
  • 260
  • 319
  • 2
    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 Feb 22 '10 at 00:00
  • 3
    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 Feb 22 '10 at 08:26
0

Try xming server + putty portable, it's awesome for remote debug. I'm using it to debug my code inside a linux VM without problems.

http://www.straightrunning.com/XmingNotes/ https://wiki.utdallas.edu/wiki/display/FAQ/X11+Forwarding+using+Xming+and+PuTTY

agodinhost
  • 381
  • 4
  • 16