How to set up the Eclipse for remote C debugging with gdbserver?

Viewed 36453

I am pretty new to Eclipse. Trying to set up to do remote debugging.

Here is situation, I am connecting to remote machine running Linux, I am running Windows.

1) I have installed all the necessary tool for Eclipse, and was able to connect to Linux machine.

2) Remote machine has gdbserver

linux1[1]% gdbserver
Usage:  gdbserver [OPTIONS] COMM PROG [ARGS ...]
        gdbserver [OPTIONS] --attach COMM PID
        gdbserver [OPTIONS] --multi COMM

COMM may either be a tty device (for serial debugging), or
HOST:PORT to listen for a TCP connection.

Options:
  --debug               Enable debugging output.

Do I need to configure anything in gdbserver ???

3) What else should I configure in Eclipse ? for remote debugging ?

4) Does it matter that my GDB version is different from remote Machine GDB ?

3 Answers

Update for Eclipse 2019-03

In eclipse 2019, the above steps didn't work, because Eclipse has changed the layout of the configuration in "C/C++ Remote Application".

Updates of @Ciro post:

The following steps worked with me: Under "Debug Configurations" Under "C / C++ Remote Application" Under the tab "Main":

  • select the "Connection" ==> "Remote Host".
  • select "New" , "SSH" (In my case) , then enter the configuration for your remote target machine.
  • in "Remote Absolute File Path for C/C++ Application:" set the path of the application in the target/remote device.

Under the tab "Debugger":

  • Sub-tab "Connection" has been removed.
  • New sub-tab "Gdbserver Settings" has been added.
  • Configure "Gdbserver path:" to point to the path of gdbserver. In my case it was "/usr/bin/gdbserver"
  • Configure port number

These are the only changes I made so that the previous answer works with me.

Related