Please nominate your Qt Champions for 2021!

QT-Creator: Remote deploy and debug to generic linux device

  • Hello everyone,

    I am on Ubuntu 20.04 development system with QT-Creator 4.13.2. It is also build system for a cross compile binary which I build locally with a custom toolchain. This step works. If I hit build, it produces a binary. Readelf tells me it is right architecture. If I copy this file manually to the target aarch64 device, it starts and runs.

    Now there are some problems with the deploying and debugging steps:

    Deploying step:
    I go to "Projects" (Ctrl+5) and the first topic is "Deployment"

    In Deployment, I have set under "Files to deploy":

    • /home/user1234/binary_stripped
    • /home/user1234/
    • /home/user1234/

    The binary I want to execute has a dependency on my and is started by an init_script. This script evalutes parameters needed for starting the binary and sets LD_LIBRARY_PATH so a proper value. It already starts gdbserver on a specified port with the binary and all parameters.

    I defined two steps in deployment:

    1. Stripping the binary locally. So the binary actually being built is "binary". After this command, there is also the stripped version with "binary_stripped" in the same local directory.
    2. Upload files via SFTP
      none of the checkboxes "Incremental deployment" or "Ignore missing files" is checked.

    If I right click the project and select "Deploy" it directly gives me in "Issues" tab: "Remote process finished with exit code 1."

    The output on the command line from QT-Creator is:

    • After right clicking the project:
      SOFT ASSERT: "projectMenu->actions().isEmpty()" in file /build/qtcreator-Tw7ZRH/qtcreator-4.13.2/src/plugins/projectexplorer/projectexplorer.cpp, line 3350
      SOFT ASSERT: "folderMenu->actions().isEmpty()" in file /build/qtcreator-Tw7ZRH/qtcreator-4.13.2/src/plugins/projectexplorer/projectexplorer.cpp, line 3355
    • After hitting deploy:
      SOFT ASSERT: "false" in file /build/qtcreator-Tw7ZRH/qtcreator-4.13.2/src/plugins/projectexplorer/buildstep.cpp, line 203
      three times

    None of the files was transferred to the remote target. The "test" in devices shows it is there but without rsync, so it uses SFTP instead. I log in with public key. No password needed

    I could not go to the debug part yet, but I need QT-Creator to connect with an already running GDB Server on a specified port because of the start script.

    My two questions are:

    1. Why is the deploy not working?
    2. What exactly happens on the debug part? Does QT-Creator remotely start gdbserver with the given run command or am I able to specify those steps, too?

    Thanks so far

  • I completely forgot to ask if this is even the "usual" or "preferred" way to cross build, deploy and remote debug?

    My only concern is to start with the start script, so the executable itself and the called command actually differ