Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-84167

Unable to debug binaries in embedded cross-compile (QEMU, gcc-arm64)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.1.0 Alpha
    • 6.0.0
    • Device Creation
    • None
    • Linux/Yocto
    • ca8a34f6879798985705a60145b710b99e7a4dde

    Description

      It is very non-trivial to build Qt correctly to be able to debug it on QEMU-powered arm64. Currently I experience issues with the yocto debugger as if my binaries lack debug info.

      The steps to reproduce:
      1. Prepare VM (see Linux QEMU (gcc-arm64) on Linux Ubuntu_18_04 (gcc-x86_64) in Coin)
      2. Connect to the VM, git clone Qt (dev branch) from code.qt.io
      3. Configure & build (used out-of-source build):

      configure -opensource -confirm-license -verbose -debug  -nomake examples -no-compile-examples -openssl -device linux-generic-g++ -device-option CROSS_COMPILE=/opt/yocto-arm64/sysroots/x86_64-pokysdk-linux/usr/bin/aarch64-poky-linux/aarch64-poky-linux- -device-option DISTRO_OPTS=boot2qt -sysroot /opt/yocto-arm64/sysroots/aarch64-poky-linux -extprefix /home/qt/work/install -mysql_config /opt/yocto-arm64/sysroots/aarch64-poky-linux/usr/bin/mysql_config -psql_config /dev/null -tslib -no-optimize-debug -skip qtwebengine -skip qtpim -no-pch -make tests
      

      This configuration claims to build in debug, also "-g" compile flag is visible during make stage
      4. Set up environment as in QEMU debug instruction
      5. Running under QEMU is successful. For example:

      ./target_wrapper.sh qemu-aarch64 ./tst_qdatetime
      

      6. But debugging is not (see QEMU debug instruction for steps clarification).
      To wait for debugger connection:

      ./target_wrapper.sh qemu-aarch64 -g 1234 ./tst_qdatetime
      

      Attaching the debugger is done via:

      target remote localhost:1234
      

      I can successfully attach and set breakpoints. However, running the binary ("continue" command in this setting) ignores all the breakpoints. It looks as if I have a build with no debug information and thus the debugger is unable to break where requested. However, I can clearly see from the build log that "-g" option is used. Also, tests claim that configuration is "debug build" when executed.
      Attached debugger log, looks rather OK to me (no errors visible).

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              sapiippo Samuli Piippo
              agolubev Andrei Golubev
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes