Profile QT, QML application, on a Linux system ( DaVinci board)

519 Views Asked by At

Good evening, I inherited a project made using QT creator (C++ and Qt Quick). The target is a DaVinci DM8168 board with **Linux kernel 2.6.37 **on it.

In particular I'm using Qt Creator 4.2.0 (4.2.0) Based on Qt 5.7.1 (GCC 4.9.1 20140922 (Red Hat 4.9.1-10), 64 bit)

I can build & run the application for the target and I can see it running.

I need to launch the profiler. But it does not work. When i run the application (on the target) using the parameter:

qmljsdebugger=port:xxxx

then the application does not start anymore!

I tried to add these options to the project's .pro file:

DEFINES   ''    +=  QMLJSDEBUGGER         
DEFINES   ''    +=  QT_DECLARATIVE_DEBUG   
PACKAGECONFIG_append = " qml-debug"

I, obviously, build in debug mode.

When I try to run the applicative on the target i get this message:

QML debugging is enabled. Only use this in a safe environment. Process killed by signal

I repeat: if the option "qmljsdebugger=port:xxxx" is removed then the application starts and works properly.. but of course the profiler wouldn't connect in this case.

As I said, I've inherited the project and I'm complete new to this environment.

Any help or suggestion?

update

these are now the lines I've added to the .pro file

DEFINES   ''    +=  QMLJSDEBUGGER
DEFINES   ''    +=  QT_QML_DEBUG
CONFIG          +=  qml_debug

I checked the various path for QT and exported PATH and LD_LIBRARY_PATH. Unfortunately nothing changes: If I launch my program using:

  /opt/MyPrefix/MyProgram -platform eglfs 

then it works.

if I use:

   /opt/MyPrefix/MyProgram -qmljsdebugger=port:3456 -platform eglfs 

then it crashes

QML debugging is enabled. Only use this in a safe environment. Segmentation fault

the program seems to start in Debug Mode and this is ok. The problem is the profiler :(

ps: As far as I know there are no firewalls running on the target. I'll check better for sure.

update 2

I tryed the same solutions as above but on a simple program as suggested(an "hello world" basically) and it does not crash when the "-qmljsdebugger=port:3456" option is specified... I really don't know what the problem is in my original application.

1

There are 1 best solutions below

0
On

First there are a few prerequisites to make qml debug run like being sure that Qt was built with the exact same toolchain as the binary. You should take a look at Qt Wiki: https://wiki.qt.io/How_To_Profile_QML_App_on_Embedded_Device

An important note is that how you make qml debugging works has changed between Qt Quick 1 and Qt Quick 2. As you are using Qt 5, I believe you should be using Qt Quick 2. So that means that you should not use QT_DECLARATIVE_DEBUG, but QT_QML_DEBUG.

More details: https://doc.qt.io/qt-5/qtquick-debugging.html#qml-debugging-infrastructure

If you still have issue after using the proper DEFINES and making sure that evry prerequisite was met, then you should try with a basic Qt program that does nothing, but display a simple QML item (like a Rectangle or a Button) ans see if you still have the issue.