Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote debugging using gnu DDD

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)
like image 917
Aaron Avatar asked Feb 21 '10 09:02

Aaron


People also ask

What is DDD GDB?

For C and C++ programs, gdb and ddd are debuggers that you can use. ddd is a easy-to-use GUI wrapper around an inferior debugger (gdb for GNU compiled C or C++ code). ddd allows you to interact with the debugger by using either GUI menu options or the under-lying debugger's command line interface.

How do I use GDB remote?

To start remote debugging, run GDB on the host machine, and specify as an executable file the program that is running in the remote machine. This tells GDB how to find your program's symbols and the contents of its pure text. Start GDB on the host, and connect to the target (see section Connecting to a remote target).

What is GNU debugger in Linux?

GDB stands for the “Gnu DeBugger.” This is a powerful source-level debugging package that lets you see what is going on inside your program. You can step through the code, set breakpoints, examine and change variables, and so on. Like most Linux tools, GDB itself is command line driven, making it rather tedious to use.


1 Answers

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.

like image 187
filofel Avatar answered Sep 28 '22 08:09

filofel