5

Using Qt Creator 2.7.1 and Qt 4.8.4, I made a Qt library and a simple Qt app that dynamically links against this library. I am attempting to remotely deploy and debug my App and step into my library functions when I call them. I can successfully set breakpoints and debug remotely, but I cannot step into my library functions using the debugger ( gdb ). When I first remotely launch my application using QtCreator in debug mode, I am met with the following warnings:

Could not load shared library symbols for 7 libraries, e.g. libcustom-stuff.so.1.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?

My debugger is setup using QtCreator as shown in these images ( Note that I have switched both the 'Target Path' and 'Path' in image #3 but it did not help: enter image description here enter image description here enter image description here

My 'Kit' is setup as follows:

enter image description here

In the 'Debugger Log' within Qt Creator I entered the 'Command':

info sharedlibrary

To which I got the response:

>~"From        To          Syms Read   Shared Object Library\n"
>~"0x400007e0  0x40011bf0  Yes         /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/lib/ld-linux.so.3\n"
>~"                        No          libcustom-stuff.so.1\n"
>~"0x4006d018  0x400d7124  Yes         /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtDBus.so.4\n"
>~"0x401065c4  0x4013dd18  Yes         /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtXml.so.4\n"
>~"0x40172430  0x4024c1b4  Yes         /home/user/proj/output/buildroot/host/usr/arm-buildroot-linux-gnueabi/sysroot/usr/lib/libQtNetwork.so.4\n"

I also ensured that both the library and app were built with:

CONFIG+=declarative_debug

In the 'Compile Output' pane for both the library and app I see the '-g' flag.

They both reside in the same directory on the file system so what is going on! Howcome I can debug and set breakpoints in the App, but not step into the Library calls? Any ideas are greatly appreciated.

UPDATE:

As per the suggestion by kikeenrique, I tried to load the debugging symbols from my Ubuntu Host ( not the ARM target ):

GNU gdb (Ubuntu/Linaro 7.4-0~69~lucid1) 7.4
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Welcome to Fluke GDB Init Script for QtCreator
Reading symbols from /home/user/proj/output/exported-nfs/home/user/libcustom-stuff.so.1.0.0...done.
(gdb)

It seems GDB could load the symbols at least..

PhilBot
  • 748
  • 18
  • 85
  • 173

1 Answers1

6

Are you using a different architecture for your remote app?

If they are different you would need to use the same gdb server and client arch.

Try setting LD_LIBRARY_PATH in your project->build & Run->build environment with the path to your library.

kikeenrique
  • 2,589
  • 2
  • 25
  • 46
  • Yes remote arch is ARM. I can debug just fine in my main app but cannot step into my Library ( also built for ARM ) from debugging my main app. – PhilBot Jun 03 '13 at 15:04
  • @philbot Try loading your symbol-file by hand in gdb(command symbol-file path/to/your/library). What is the path for libcustom-stuff.so? – kikeenrique Jun 03 '13 at 15:13
  • I could load them by hand from my Host machine - see my edited post above. Both the App and the Library are in /home/user on the target. – PhilBot Jun 03 '13 at 15:22
  • @PhilBot could you try setting LD_LIBRARY_PATH in your project->build & Run->build environment with the path to your library? – kikeenrique Jun 04 '13 at 09:20
  • 1
    Wow - this worked, my LD_LIBRARY_PATH was wrong. Thank you very much. – PhilBot Jun 04 '13 at 13:03
  • Hi guys, Could you please elaborate a bit more about this? I am trying to add the LD_LIBRARY_PATH to the enviromental variables but it does not work. Could you show what is the right path in your example? – Łukasz Przeniosło Oct 30 '16 at 11:03