Debug shared object on remote device with QtCreator?
-
wrote on 4 Apr 2016, 06:31 last edited by
I created a simple hello world application and link a shared object. Now I want to debug but I can't step into the library code.
My environment is a Ubuntu 14.04 connected with a Raspberry Pi 2 with Qt5.6 Libraries. Qt works successfully but I can't find some setting I have to add to the .pro file to get this work.
Any ideas?
-
Does the library contain debug symbols?
You need a debug build of that library. -
Lifetime Qt Championwrote on 4 Apr 2016, 07:36 last edited by jsulm 4 Apr 2016, 07:37
What happens if you try to step into the library?
Do you see assembler code?
And does your app link against the debug build of that library? -
What happens if you try to step into the library?
Do you see assembler code?
And does your app link against the debug build of that library? -
What happens if you try to step into the library?
Do you see assembler code?
And does your app link against the debug build of that library?wrote on 4 Apr 2016, 07:59 last edited byDo you see assembler code?
no
And does your app link against the debug build of that library?
yes, because the build folder includes name debug.I checked the output again and I get some console outputs:
Could not load shared library symbols for 2 libraries, e.g. /usr/bin/QSettingsDemo. Use the "info sharedlibrary" command to see the complete listing. Do you need "set solib-search-path" or "set sysroot"?File "/usr/arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libstdc++.so.6.0.19-gdb.py" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
-
You should check with ldd whether your app really links against debug build of that library. Being built in the debug directory does not mean it is linked against debug build of a library.
-
"Could not load shared library symbols for 2 libraries, e.g. /usr/bin/QSettingsDemo" - that says that these two libraries do not contain symbols (release build).
-
"Could not load shared library symbols for 2 libraries, e.g. /usr/bin/QSettingsDemo" - that says that these two libraries do not contain symbols (release build).
wrote on 4 Apr 2016, 08:30 last edited by@jsulm I got this output with ldd
ldd /usr/lib/libDemoLibrary.so.1.0.0 checking sub-depends for '/usr/lib/libQtNetwork.so.4' checking sub-depends for '/usr/lib/libQtCore.so.4' checking sub-depends for '/lib/libpthread.so.0' ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0xb6f02000) libdl.so.0 => /lib/libdl.so.0 (0xb6ef6000) libc.so.0 => /lib/libc.so.0 (0xb6ea8000) checking sub-depends for '/usr/lib/libstdc++.so.6' checking sub-depends for '/lib/libm.so.0' libc.so.0 => /lib/libc.so.0 (0xb6f54000) ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0xb6fa2000) checking sub-depends for '/lib/libgcc_s.so.1' checking sub-depends for '/lib/libc.so.0' ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0xb6f52000) checking sub-depends for '/lib/libdl.so.0' libc.so.0 => /lib/libc.so.0 (0xb6f77000) ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0xb6fc5000) checking sub-depends for '/lib/librt.so.0' libc.so.0 => /lib/libc.so.0 (0xb6f3e000) libdl.so.0 => /lib/libdl.so.0 (0xb6f32000) libpthread.so.0 => /lib/libpthread.so.0 (0xb6f17000) ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0xb6f8c000) libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x00000000) libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x00000000) libpthread.so.0 => /lib/libpthread.so.0 (0x00000000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00000000) libm.so.0 => /lib/libm.so.0 (0x00000000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00000000) libc.so.0 => /lib/libc.so.0 (0x00000000) libdl.so.0 => /lib/libdl.so.0 (0x00000000) librt.so.0 => /lib/librt.so.0 (0x00000000) /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000) /lib/ld-uClibc.so.0 => /lib/ld-uClibc.so.0 (0x00000000)
-
I actually meant to use ldd with the executable.
Is /usr/lib/libDemoLibrary.so.1.0.0 the library you want to debug?
Is it built in debug or release mode?
What does "nm /usr/lib/libDemoLibrary.so.1.0.0" say? -
wrote on 4 Apr 2016, 08:46 last edited by fl0mll 4 Apr 2016, 08:46
@jsulm I found a nice information http://visualgdb.com/gdbreference/commands/set_solib-search-path
Now I set the solib-search-path on the gdb Additional Startup Commands and it works. It takes some seconds before it could step into but it works.
This way is not comfortable so is there a way to add this to the .pro file?
1/12