Remote debugging using gdb server and client not working

goldenmean picture goldenmean · Oct 21, 2014 · Viewed 7.1k times · Source

I am trying to get going remote debugging using gdbserver running on a ARM target running Linux kernel version 2.6.38.8.

On this target I run a gdbserver which is a 32-bit ELF file, as below:

./gdbserver --remote-debug --attach 192.xxx.xxx.2:2345 1600

Attached; pid = 1600
Listening on port 2345

The gdb server on starting says:

This gdbserver was configured as "arm-none-linux-gnueabi"

On a Ubuntu (32 bit) machine I run the GDB client which also seems 32 bit(/usr/bin/gdb) as below to connect to the remote GDB server. On the GDB prompt I enter as below:

(gdb) **target remote 192.xxx.xxx.2:2345**

Remote debugging using 192.xxx.xxx.2:2345

**warning: Architecture rejected target-supplied description**

Below are errors I see on the GDB prompt of the client:

Remote 'g' packet reply is too long: fcfdffff901bdbbe84d00e4002000000000000000000000000000100a2000000901bdbbe0000000000a006400000000000000000f819dbbe34bd3a4044bd3a40100000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008c4200b808422200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000
(gdb)

After issuing this command, I see below error on target gdbserver:

Remote debugging from host 192.xxx.xxx.28

**readchar: Got EOF**

Remote side has terminated connection.  GDBserver will reopen the connection.

The client gdb says:

This GDB was configured as "**i686-linux-gnu**".

Note: Also tried running gdbserver on the target with the --target-debug option, but still it did not work, but it spitted more errors on the server upon the client trying to connect. I can put up those errors if it helps.

See the Errors.

What is the error saying?

What is the mismatch between server, client?

How can I resolve this and get it working?

Answer

goldenmean picture goldenmean · Nov 21, 2014

I have managed to get a GDB server and GDB client which have worked for my 32-bit Ubuntu (client GDB) and ARM Cortex A8 target (GDB server). I got the pre-built binaries from the Linaro toolchain binaries link.

These worked perfectly!

I also tried a later version of the 4.9 toolchain, and it worked as well.