Sorry, you need to enable JavaScript to visit this website.

How to install gdbserver ?

Unsolved
6 posts / 0 new
WilliamTai's picture
WilliamTai
Junior(0)
How to install gdbserver ?

Dear all,
I'm new in Embedded Linux programing, using ARM DS-5, following "ARM DS‐5 Tools and Avnet ZED Series #5 --Debug a Linux Application using DS‐5 and Avnet ZedBoard or MicroZed".
(http://www.zedboard.org/sites/default/files/design/Zynq_Debug_Online_v01...)

I tried to remote debug Hello World example on Zedboard, Linaro as filesystem (Ubuntu 12.11) but I don't know how to setup gdbserver.

hockeyman1972's picture
hockeyman1972
Junior(11)
More info needed

Hi William,
If you have selected the right debug configuration, DS-5 will launch a new instance of gdbserver (default port 5000) with the path to your application automatically. You shouldn't have to configure it on your own. What sort of error are you seeing?

WilliamTai's picture
WilliamTai
Junior(0)
-bash: ./hello: No such file or directory

Thanks for reply.

DS-5 shows some error messages in App Console.

# cd "/tmp"
# export LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH"
# gdbserver :5000 "./hello"
Process ./hello created; pid = 2362
Cannot exec ./hello: No such file or directory.

Child exited with status 127
No program to debug. GDBserver exiting.

It seems the file had been downloaded with no problem, permission right too.

-rwxr-xr-x 1 root root 2864 Nov 8 12:41 hello

I tried to execute it directly.

#./hello
-bash: ./hello: No such file or directory

Also tried on SpeedWay Linux too, it was downloaded and debug successfully.

WilliamTai's picture
WilliamTai
Junior(0)
" No such file or directory" for an exisiting executable file

It seems like " No such file or directory" for an exisiting executable file issue.

hockeyman1972's picture
hockeyman1972
Junior(11)
Incompatible Distribution files

William,
I think this might be an incompatibility issue between the distribution files used to build your program within DS-5, and the Ubuntu platform running on the target. I don't think this has anything to do with gdbserver itself, which seems to be working correctly but cannot run the executable you built. As you found out, you can't run it either from the command line, so there's no way gdbserver will be able to either.

I'll track down a solution and post it here as soon as I have it.

hockeyman1972's picture
hockeyman1972
Junior(11)
Missing Link in Ubuntu

Sorry, this took me a while to figure out.

I was able to recreate this problem, and I found that while the hello elf in the DS-5 distribution would not run on Ubuntu, if you compiled the same program natively on Ubuntu, it worked fine. I used the command:

readelf -a <filename>

to examine the files, and I found that in the DS-5 version, it is looking for:

[Requesting program interpreter: /lib/ld-linux.so.3]

The same command on the working elf shows:

[Requesting program interpreter: /lib/ld-linux-armhf.so.3]

So I created a link to redirect the missing reference on the Ubuntu target as follows:

sudo ln /lib/ld-linux-armhf.so.3 /lib/linux.so.3

Once I did that, I found I could execute the DS-5 hello elf. With that in place, I went back to DS-5 and was able to download, execute and debug the hello elf as usual.