3
votes

I am using X-server on Linux tutnix 3.13.0-30-generic #54-Ubuntu i686 i686 GNU/Linux .

On X-server i am using schroot to change the root and after that I run my application on it.

Now the problem is I am trying to run gdbserver(version 6.7.1) on X-server(say it remote machine) and gdb(version 7.7) on Ubuntu machine(local machine or the machine where X-server is running), but its not working.

This is what I tried so far:-

  1. executed below commands on remote machine

    • MY_Application &
    • gdbserver localhost:8888 --attach process_id
  2. executed below commands on local machine

    • gdb ./MY_Application
    • (gdb)target remote :8888

Now on local machine gdb is showing this message

Could not load shared library symbols for 20 libraries, e.g. /usr/lib/libqt.so.3. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"?

As far as understand it, gdb is not able to load the shared libraries and there are 20 of them. As a result of this I am not able to find the symbols present in these shared libraries.

I tried to load the symbols from library files on local machine using symbol-file command on gdb but that leads to address mismatch

So I used the below command

  • (gdb)set sysroot remote:/

but it is again showing an error message

Could not open 'remote:/usr/local/davis/lib/usr/lib/libqt.so.3' as an executable file: Function not implemented

Can anyone please tell me what am I doing wrong here? If there is an alternate solution to load the symbols from shared libraries please suggest.

P.S. Both the MY_Application binaries are same.

1

1 Answers

1
votes

Finally i found a solution for my problem. The problem was in step 2 shown above. Somehow gdb was not loading all the symbols and PATH to shared libraries. Although PATH shown with ldd command was accurate. But still it was not working for me if I simply run the gdb ./MY_Application So I executed one more command after this i.e.

file MY_Application

and also copied library file from /srv/chroot/loc/usr/local/davis/lib/ to /usr/local/davis/lib/ after this I connect it to remote server and now it is working fine.