Debugging is an important step in development. Even though, we can simulate the target HW behavior and exercise most of our code, there are times where debugging with the application running on the target becomes very critical. As a embedded developer, we should execute/debug our program on the HW and make sure it behaves as expected.

Eclipse and gdb make it easier to debug programs on the target.We will use gdbserver to debug our program on the remote target.

From the man-pages:

gdbserver is a program that allows you to run GDB on a different machine than the one which is running the program being debugged.

Refer to the link here for more information on gdbserver.

Follow the steps below to step through your program. We will use the blinking LED program from the previous chapter as an example.

  • Make sure you can build the program and is visible on the target.

On the target:

  • On the target, execute the following
sudo gdbserver :1980 dragonboard_led_sys
  • This will create a process and will start listening on port 1980 for the remote debug to begin. This number can be anything > 1023 (below this are all reserved)

On the  host machine (inside Eclispe):

  • We need to configure eclipse to communicate with the target using gdbserver
  • Select the application (shown in the screen shot below):
    • In the project navigator, right click on the LED project and select Debug As -> Debug Conjurations
    • On the main tab, Select C/C++ Application and point to the LED program executable (You have to browse to the project and manually select it).
  • Select the Preferred Launcher (shown in the screen shot below):
    • Select other for the Using Debug Process Launcher.
      • On the new pop-up window, select Legacy Create Process Launcher.
  • Select the debugger (shown in the screen shot below):
    • On the debugger tab, select gdbserver for the debugger.
    • Stop at main on startup.
    • GDB debugger: aarch-linux-gnu-gdb (this is our dragonboard debugger).
    • On the connection sub-tab, select TCP for the type of connection.
    • Enter the target IP address (dragonboard IP address).
    • Enter 1980 for the port number. Or any number you choose while executing on dragonboard.
  • Click Debug.
  • This should open up a new debug perspective for the application (shown in the screenshot below).
    • The execution will be stopped at main and waiting for you to continue.
    • Spend sometime on the perspective.
    • Take a look at variable pane, debug pane, breakpoints, disassembly, etc …

On the target you should see a remote debugging from host (host IP address) printed. It’s a very small program, so we can just hit F6 and step through.

There you have it, you are remote debugging your program on directly on the target.

Debugging on the target machine is very important and sometimes there are no alternatives but to debug live. Eclipse and gdb make it easier!

Debug Configuration



Preffered Launcher



Debugger Settings



Debug Perspective


gdb command on the target


Remote debugging on the target

Add comment

Security code