Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Debug shared object on remote device with QtCreator?
Forum Updated to NodeBB v4.3 + New Features

Debug shared object on remote device with QtCreator?

Scheduled Pinned Locked Moved Qt Creator and other tools
12 Posts 2 Posters 5.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • fl0mllF Offline
    fl0mllF Offline
    fl0mll
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Does the library contain debug symbols?
      You need a debug build of that library.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      fl0mllF 1 Reply Last reply
      0
      • jsulmJ jsulm

        Does the library contain debug symbols?
        You need a debug build of that library.

        fl0mllF Offline
        fl0mllF Offline
        fl0mll
        wrote on last edited by
        #3

        @jsulm yes both are enabled for debug target.

        fl0mllF 1 Reply Last reply
        0
        • jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by jsulm
          #4

          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?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          fl0mllF 2 Replies Last reply
          0
          • fl0mllF fl0mll

            @jsulm yes both are enabled for debug target.

            fl0mllF Offline
            fl0mllF Offline
            fl0mll
            wrote on last edited by
            #5

            @fl0mll I tried the same application on desktop build and this works.

            1 Reply Last reply
            0
            • jsulmJ jsulm

              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?

              fl0mllF Offline
              fl0mllF Offline
              fl0mll
              wrote on last edited by
              #6

              @jsulm If I step into the QtCreator wait for some seconds and returns at the next line. If I try the same on Desktop it steps into the library code.

              1 Reply Last reply
              0
              • jsulmJ jsulm

                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?

                fl0mllF Offline
                fl0mllF Offline
                fl0mll
                wrote on last edited by
                #7

                @jsulm

                Do 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".
                
                1 Reply Last reply
                0
                • jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  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.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply
                  0
                  • jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    "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).

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    fl0mllF 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      "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).

                      fl0mllF Offline
                      fl0mllF Offline
                      fl0mll
                      wrote on last edited by
                      #10

                      @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)
                      
                      1 Reply Last reply
                      0
                      • jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        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?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        1 Reply Last reply
                        0
                        • fl0mllF Offline
                          fl0mllF Offline
                          fl0mll
                          wrote on last edited by fl0mll
                          #12

                          @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 Reply Last reply
                          1

                          • Login

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • Users
                          • Groups
                          • Search
                          • Get Qt Extensions
                          • Unsolved