Aaron
Aaron

Reputation: 2863

Remote debugging using gnu DDD

Question:

Example:

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

Upvotes: 11

Views: 10187

Answers (3)

agodinhost
agodinhost

Reputation: 391

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

Upvotes: 0

filofel
filofel

Reputation: 1378

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.

Upvotes: 6

Nathan Fellman
Nathan Fellman

Reputation: 127428

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 +

Upvotes: 3

Related Questions