Merge remote-tracking branch 'origin/10.0'
Conflicts: cmake/QtCreatorIDEBranding.cmake qbs/modules/qtc/qtc.qbs src/plugins/remotelinux/genericlinuxdeviceconfigurationwidget.cpp src/tools/perfparser Change-Id: Ie5643100e0eb00e0933359dce320169b876f5634
26
README.md
@@ -56,6 +56,32 @@ Prerequisites:
|
|||||||
|
|
||||||
The used toolchain has to be compatible with the one Qt was compiled with.
|
The used toolchain has to be compatible with the one Qt was compiled with.
|
||||||
|
|
||||||
|
### Getting Qt Creator from Git
|
||||||
|
|
||||||
|
The official mirror of the Qt Creator repository is located at
|
||||||
|
https://code.qt.io/cgit/qt-creator/qt-creator.git/. Run
|
||||||
|
|
||||||
|
git clone https://code.qt.io/qt-creator/qt-creator.git
|
||||||
|
|
||||||
|
to clone the Qt Creator sources from there. This creates a checkout of the
|
||||||
|
Qt Creator sources in the `qt-creator/` directory of your current working
|
||||||
|
directory.
|
||||||
|
|
||||||
|
Qt Creator relies on some submodules, like
|
||||||
|
[litehtml](https://github.com/litehtml) for displaying documentation. Get these
|
||||||
|
submodules with
|
||||||
|
|
||||||
|
cd qt-creator # switch to the sources, if you just ran git clone
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
Note the `--recursive` in this command, which fetches also submodules within
|
||||||
|
submodules, and is necessary to get all the sources.
|
||||||
|
|
||||||
|
The git history contains some coding style cleanup commits, which you might
|
||||||
|
want to exclude for example when running `git blame`. Do this by running
|
||||||
|
|
||||||
|
git config blame.ignoreRevsFile .gitignore-blame
|
||||||
|
|
||||||
### Linux and macOS
|
### Linux and macOS
|
||||||
|
|
||||||
These instructions assume that Ninja is installed and in the `PATH`, Qt Creator
|
These instructions assume that Ninja is installed and in the `PATH`, Qt Creator
|
||||||
|
|||||||
@@ -840,7 +840,12 @@ function(add_qtc_test name)
|
|||||||
endif()
|
endif()
|
||||||
set(${_build_test_var} "${_build_test_default}" CACHE BOOL "Build test ${name}.")
|
set(${_build_test_var} "${_build_test_default}" CACHE BOOL "Build test ${name}.")
|
||||||
|
|
||||||
if (NOT ${_build_test_var} OR NOT ${_arg_CONDITION})
|
if ((${_arg_CONDITION}) AND ${_build_test_var})
|
||||||
|
set(_test_enabled ON)
|
||||||
|
else()
|
||||||
|
set(_test_enabled OFF)
|
||||||
|
endif()
|
||||||
|
if (NOT _test_enabled)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@@ -868,7 +873,6 @@ function(add_qtc_test name)
|
|||||||
DEFINES ${_arg_DEFINES} ${TEST_DEFINES} ${default_defines_copy}
|
DEFINES ${_arg_DEFINES} ${TEST_DEFINES} ${default_defines_copy}
|
||||||
EXPLICIT_MOC ${_arg_EXPLICIT_MOC}
|
EXPLICIT_MOC ${_arg_EXPLICIT_MOC}
|
||||||
SKIP_AUTOMOC ${_arg_SKIP_AUTOMOC}
|
SKIP_AUTOMOC ${_arg_SKIP_AUTOMOC}
|
||||||
CONDITION ${_arg_CONDITION}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(${name} PROPERTIES
|
set_target_properties(${name} PROPERTIES
|
||||||
@@ -988,7 +992,10 @@ function(qtc_add_resources target resourceName)
|
|||||||
message(FATAL_ERROR "qtc_add_resources had unparsed arguments!")
|
message(FATAL_ERROR "qtc_add_resources had unparsed arguments!")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (DEFINED _arg_CONDITION AND NOT _arg_CONDITION)
|
if (NOT _arg_CONDITION)
|
||||||
|
set(_arg_CONDITION ON)
|
||||||
|
endif()
|
||||||
|
if (NOT (${_arg_CONDITION}))
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
26
dist/changelog/changes-10.0.0.md
vendored
@@ -48,6 +48,7 @@ Editing
|
|||||||
* Made temporary disabling of global indexing possible by canceling it in the
|
* Made temporary disabling of global indexing possible by canceling it in the
|
||||||
progress indicator
|
progress indicator
|
||||||
* Added support for highlighting angle brackets
|
* Added support for highlighting angle brackets
|
||||||
|
* Added semantic highlighting for concepts (QTCREATORBUG-28887)
|
||||||
* Built-in
|
* Built-in
|
||||||
* Added support for the spaceship operator (QTCREATORBUG-27503)
|
* Added support for the spaceship operator (QTCREATORBUG-27503)
|
||||||
* Fixed the handling of `= default` (QTCREATORBUG-28102)
|
* Fixed the handling of `= default` (QTCREATORBUG-28102)
|
||||||
@@ -99,23 +100,28 @@ Projects
|
|||||||
|
|
||||||
* Added a deployment method with `cmake --install` to `Projects > Run Settings >
|
* Added a deployment method with `cmake --install` to `Projects > Run Settings >
|
||||||
Add Deploy Step > CMake Install` (QTCREATORBUG-25880)
|
Add Deploy Step > CMake Install` (QTCREATORBUG-25880)
|
||||||
* Added the option to use `cmake-format` for CMake files to `Edit > Preferences >
|
* Added the option to use `cmake-format` for CMake files to `Edit > Preferences
|
||||||
CMake > Formatter`
|
> CMake > Formatter`
|
||||||
([cmake-format Documentation](https://cmake-format.readthedocs.io/en/latest/))
|
([cmake-format Documentation](https://cmake-format.readthedocs.io/en/latest/))
|
||||||
* Added `Show advanced options by default` to `Edit > Preferences > CMake > Tools`
|
* Added `Show advanced options by default` to `Edit > Preferences > CMake > Tools`
|
||||||
* Added support for the `external` strategy for the architecture and toolset of
|
* Added support for presets version 5
|
||||||
presets (QTCREATORBUG-28693)
|
* Added support for the `external` strategy for the architecture and toolset
|
||||||
|
of presets (QTCREATORBUG-28693)
|
||||||
|
* Added support for preset includes (QTCREATORBUG-28894)
|
||||||
|
* Added support for the `pathListSep` variable
|
||||||
|
* Fixed that CMake preset macros were not expanded for environment variables and
|
||||||
|
`CMAKE_BUILD_TYPE` (QTCREATORBUG-28606, QTCREATORBUG-28893)
|
||||||
* Moved `Autorun CMake` to `Edit > Preferences > CMake > General`
|
* Moved `Autorun CMake` to `Edit > Preferences > CMake > General`
|
||||||
* Changed the environment for running CMake to be based on the build environment
|
* Changed the environment for running CMake to be based on the build environment
|
||||||
by default (QTCREATORBUG-28513)
|
by default (QTCREATORBUG-28513)
|
||||||
* Fixed that `Package manager auto setup` created a dependency of the project
|
|
||||||
build to the Qt Creator installation
|
|
||||||
* Fixed that cloned build configurations could miss values from the `Initial
|
* Fixed that cloned build configurations could miss values from the `Initial
|
||||||
Parameters` (QTCREATORBUG-28759)
|
Parameters` (QTCREATORBUG-28759)
|
||||||
* Fixed that CMake preset macros were not expanded for environment variables
|
|
||||||
(QTCREATORBUG-28606)
|
|
||||||
* Fixed a crash with the `Kit Configuration` button for build configurations
|
* Fixed a crash with the `Kit Configuration` button for build configurations
|
||||||
(QTCREATORBUG-28740)
|
(QTCREATORBUG-28740)
|
||||||
|
* Package manager auto setup
|
||||||
|
* Added support for Conan 2.0
|
||||||
|
* Fixed that it created a dependency of the project build to the Qt Creator
|
||||||
|
installation
|
||||||
|
|
||||||
### Qbs
|
### Qbs
|
||||||
|
|
||||||
@@ -209,6 +215,7 @@ Platforms
|
|||||||
* Added support for loading and attaching to core dumps from remote devices
|
* Added support for loading and attaching to core dumps from remote devices
|
||||||
* Added support for using ClangFormat on remote files
|
* Added support for using ClangFormat on remote files
|
||||||
* Added an option to enable necessary capabilities for debugging with LLDB
|
* Added an option to enable necessary capabilities for debugging with LLDB
|
||||||
|
to `Edit > Preferences > Devices` for a Docker device
|
||||||
* Fixed an issue with space in file paths (QTCREATORBUG-28476)
|
* Fixed an issue with space in file paths (QTCREATORBUG-28476)
|
||||||
* Fixed that auto-detection controls were shown for devices registered by the
|
* Fixed that auto-detection controls were shown for devices registered by the
|
||||||
installer
|
installer
|
||||||
@@ -237,10 +244,12 @@ Dmitry Bravikov
|
|||||||
Eike Ziller
|
Eike Ziller
|
||||||
Fabian Kosmale
|
Fabian Kosmale
|
||||||
Fawzi Mohamed
|
Fawzi Mohamed
|
||||||
|
Haowei Hsu
|
||||||
Henning Gruendl
|
Henning Gruendl
|
||||||
Jaroslaw Kobus
|
Jaroslaw Kobus
|
||||||
Jussi Witick
|
Jussi Witick
|
||||||
Kai Köhne
|
Kai Köhne
|
||||||
|
Karim Abdelrahman
|
||||||
Knud Dollereder
|
Knud Dollereder
|
||||||
Knut Petter Svendsen
|
Knut Petter Svendsen
|
||||||
Leena Miettinen
|
Leena Miettinen
|
||||||
@@ -260,6 +269,7 @@ Robert Löhning
|
|||||||
Sami Shalayel
|
Sami Shalayel
|
||||||
Samuel Gaist
|
Samuel Gaist
|
||||||
Samuel Ghinet
|
Samuel Ghinet
|
||||||
|
Semih Yavuz
|
||||||
Sergey Levin
|
Sergey Levin
|
||||||
Sivert Krøvel
|
Sivert Krøvel
|
||||||
Tasuku Suzuki
|
Tasuku Suzuki
|
||||||
|
|||||||
BIN
doc/qtcreator/images/extraimages/images/5OiIqFTjUZI.jpg
Normal file
|
After Width: | Height: | Size: 56 KiB |
@@ -1,2 +1,3 @@
|
|||||||
{HTML.extraimages,qhp.QtCreator.extraFiles} += \
|
{HTML.extraimages,qhp.QtCreator.extraFiles} += \
|
||||||
images/commercial.png
|
images/commercial.png \
|
||||||
|
images/5OiIqFTjUZI.jpg
|
||||||
|
|||||||
BIN
doc/qtcreator/images/qcreator-debugger-select-start-address.webp
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 11 KiB |
BIN
doc/qtcreator/images/qtcreator-add-breakpoint.webp
Normal file
|
After Width: | Height: | Size: 7.5 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 10 KiB |
BIN
doc/qtcreator/images/qtcreator-android-sdk-manager.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 5.6 KiB |
|
Before Width: | Height: | Size: 6.8 KiB |
|
Before Width: | Height: | Size: 4.7 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 12 KiB |
BIN
doc/qtcreator/images/qtcreator-build-settings-android-apk.webp
Normal file
|
After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 3.0 KiB |
BIN
doc/qtcreator/images/qtcreator-debug-breakpoints.webp
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.3 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-breakpoint-preset.webp
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-disassembler-view.webp
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 41 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-expressions.webp
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-log-view.webp
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-memory-editor.webp
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-modules.webp
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 2.4 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-registers-view.webp
Normal file
|
After Width: | Height: | Size: 7.3 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-source-files.webp
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-views-initial.webp
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 34 KiB |
BIN
doc/qtcreator/images/qtcreator-debugger-views.webp
Normal file
|
After Width: | Height: | Size: 9.5 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 3.9 KiB |
|
After Width: | Height: | Size: 4.3 KiB |
BIN
doc/qtcreator/images/qtcreator-preferences-testing-ctest.webp
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
doc/qtcreator/images/qtcreator-preferences-testing-general.webp
Normal file
|
After Width: | Height: | Size: 7.8 KiB |
|
After Width: | Height: | Size: 3.8 KiB |
BIN
doc/qtcreator/images/qtcreator-preferences-testing-qttest.webp
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
doc/qtcreator/images/qtcreator-run-settings-python.webp
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -8,36 +8,37 @@
|
|||||||
|
|
||||||
\title Connecting Android Devices
|
\title Connecting Android Devices
|
||||||
|
|
||||||
You can connect Android devices to the development PC using USB cables
|
You can connect Android devices to the development PC using USB cables to
|
||||||
to build, run, debug, and analyze applications from \QC. Devices with
|
build, run, debug, and analyze applications from \QC.
|
||||||
Android version 4.1 (API level 16) or later are supported when developing
|
|
||||||
with Qt 5 and devices with Android version 6.0 (API level 23) when
|
|
||||||
developing with Qt 6.
|
|
||||||
|
|
||||||
To develop for Android, you must have a tool chain for building applications
|
To develop for Android, you must install a tool chain for building
|
||||||
for Android devices installed on the development PC. \QC can automatically
|
applications for Android devices on the development PC. \QC can automatically
|
||||||
download and install the tool chain and create a suitable build and run
|
download and install the tool chain and create a suitable build and run
|
||||||
\l{glossary-buildandrun-kit}{kit} that has the tool chain and the Qt
|
\l{glossary-buildandrun-kit}{kit} that has the tool chain and the Qt
|
||||||
version for Android for the device's architecture.
|
version for Android for the device's architecture.
|
||||||
|
|
||||||
Starting from Qt 5.14.0, the Qt for Android package has all the
|
|
||||||
architectures (ABIs) installed as one.
|
|
||||||
|
|
||||||
To enable helpful code editing features for Java, such as code completion,
|
To enable helpful code editing features for Java, such as code completion,
|
||||||
highlighting, function tooltips, and navigating in code, add a
|
highlighting, function tooltips, and navigating in code, add a
|
||||||
\l{Java Language Server}{Java language server}.
|
\l{Java Language Server}{Java language server}.
|
||||||
|
|
||||||
The Android Debug Bridge (adb) command line tool is integrated to \QC to
|
\QC integrates the Android Debug Bridge (\c adb) command line tool for
|
||||||
enable you to deploy applications to connected Android devices, to run
|
deploying applications to Android devices, running them, and reading their
|
||||||
them, and to read their logs. It includes a client and server that run on
|
logs. The \c adb tool includes a client and server that run on
|
||||||
the development host and a daemon that runs on the emulator or device.
|
the development host and a daemon that runs on the emulator or device.
|
||||||
|
|
||||||
|
The following video shows the whole process from installing Qt for Android
|
||||||
|
to debugging an application on an Android device:
|
||||||
|
|
||||||
|
\youtube 5OiIqFTjUZI
|
||||||
|
|
||||||
\section1 Requirements
|
\section1 Requirements
|
||||||
|
|
||||||
To use \QC to develop Qt applications for Android, you need
|
To use \QC to develop Qt applications for Android, you need
|
||||||
\l{Qt for Android} 5.2, or later, and the tool chain that \QC
|
\l {Qt for Android} and a tool chain that \QC can automatically
|
||||||
can automatically download, install, and configure for you.
|
download, install, and configure for you. For more information
|
||||||
For more information, see \l{Manually Installing the Prerequisites}.
|
about the requirements for developing with a particular Qt version,
|
||||||
|
see the documentation for that Qt version. The links in this manual
|
||||||
|
lead to the latest released Qt reference documentation.
|
||||||
|
|
||||||
\section1 Specifying Android Device Settings
|
\section1 Specifying Android Device Settings
|
||||||
|
|
||||||
@@ -58,42 +59,39 @@
|
|||||||
\uicontrol Android on Windows and Linux or \uicontrol {\QC} >
|
\uicontrol Android on Windows and Linux or \uicontrol {\QC} >
|
||||||
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android on
|
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android on
|
||||||
\macos.
|
\macos.
|
||||||
\image qtcreator-options-android-main.png "Android preferences"
|
\image qtcreator-options-android-main.png {Android preferences}
|
||||||
\li In the \uicontrol {JDK location} field, set the path to the JDK.
|
\li In the \uicontrol {JDK location} field, set the path to the JDK.
|
||||||
\QC checks the JDK installation and reports errors.
|
\QC checks the JDK installation and reports errors.
|
||||||
|
|
||||||
By default, \QC tries to find a supported \l{AdoptOpenJDK} or
|
By default, \QC tries to find a supported \l{AdoptOpenJDK} or
|
||||||
\l{OpenJDK} installation. If none is found, you must set the path
|
\l{OpenJDK} installation. If it cannot find one, you must set the
|
||||||
manually. If you don't have a supported JDK installed, select
|
path manually. If you have not installed a supported JDK, select
|
||||||
\inlineimage icons/online.png
|
\inlineimage icons/online.png
|
||||||
to open the JDK download web page in the default browser.
|
to open the JDK download web page in the default browser.
|
||||||
|
|
||||||
\note We recommended using a 64-bit JDK because the 32-bit one
|
\note Use a 64-bit JDK because the 32-bit one might cause issues with
|
||||||
might cause issues with \c cmdline-tools, and some packages might
|
\c cmdline-tools, and some packages might not appear in the list.
|
||||||
not be listed.
|
|
||||||
\li In the \uicontrol {Android SDK location} field, set the path to the
|
\li In the \uicontrol {Android SDK location} field, set the path to the
|
||||||
folder where you want the \l{Android SDK Command-line Tools} to be
|
folder to install the \l{Android SDK Command-line Tools}.
|
||||||
installed.
|
|
||||||
\li Select \uicontrol {Set Up SDK} to automatically download and extract
|
\li Select \uicontrol {Set Up SDK} to automatically download and extract
|
||||||
the Android SDK Command-line Tools to the selected path.
|
the Android SDK Command-line Tools to the selected path.
|
||||||
|
|
||||||
The SDK Manager checks whether the tool chain is installed.
|
The SDK Manager checks that you have the necessary tools. If you need
|
||||||
If packages are missing or updates are needed, the SDK Manager
|
more packages or updates, the SDK Manager offers to add or remove
|
||||||
offers to add or remove those packages. Before taking action, it
|
the appropriate packages. Before taking action, it prompts you to
|
||||||
prompts you to accept the changes it is about to make. In addition,
|
accept the changes. In addition, it prompts you to accept Google
|
||||||
it prompts you to accept Google licenses, as necessary.
|
licenses, as necessary.
|
||||||
\li The installed NDK versions are listed in
|
\li The \uicontrol {Android NDK list} lists the installed NDK versions.
|
||||||
\uicontrol {Android NDK list}.
|
The SDK Manager installed the locked items. You can modify them only
|
||||||
The locked items were installed by the SDK Manager,
|
from the \uicontrol {Android SDK Manager} dialog. For more
|
||||||
and can only be modified from the \uicontrol {Android SDK Manager}
|
information, see \l{Managing Android NDK Packages}.
|
||||||
dialog. For more information, see \l{Managing Android NDK Packages}.
|
|
||||||
\li Select the \uicontrol {Automatically create kits for Android tool chains}
|
\li Select the \uicontrol {Automatically create kits for Android tool chains}
|
||||||
check box to allow \QC to create the kits for you. \QC displays a
|
check box to allow \QC to create the kits for you. \QC displays a
|
||||||
warning if it cannot find a suitable Qt version.
|
warning if it cannot find a suitable Qt version.
|
||||||
\li Optionally, in the \uicontrol {Android OpenSSL Settings} group, set
|
\li Optionally, in the \uicontrol {Android OpenSSL Settings} group, set
|
||||||
the path to the prebuilt OpenSSL libraries.
|
the path to the prebuilt OpenSSL libraries.
|
||||||
|
|
||||||
For Qt applications that require OpenSSL support, \QC allows to
|
For Qt applications that require OpenSSL support, you can
|
||||||
quickly add the \l {Android OpenSSL support} to your project.
|
quickly add the \l {Android OpenSSL support} to your project.
|
||||||
For more information, see \l{Adding External Libraries}.
|
For more information, see \l{Adding External Libraries}.
|
||||||
\li Select \uicontrol {Download OpenSSL} to download the OpenSSL
|
\li Select \uicontrol {Download OpenSSL} to download the OpenSSL
|
||||||
@@ -103,21 +101,20 @@
|
|||||||
|
|
||||||
\section2 Manual Setup
|
\section2 Manual Setup
|
||||||
|
|
||||||
\note We recommend that you use the latest Android SDK Command-Line Tools.
|
\note Use the latest Android SDK Command-Line Tools. \QC does not support
|
||||||
Using Android SDK Tools version 25.2.5 or earlier is not supported because
|
Android SDK Tools version 25.2.5 or earlier because it cannot fully
|
||||||
they cannot be fully integrated with \QC.
|
integrate them.
|
||||||
|
|
||||||
However, if the automatic setup does not meet your needs, you can download
|
However, if the automatic setup does not meet your needs, you can download
|
||||||
and install Android SDK Command-line Tools, and then install or update the
|
and install Android SDK Command-line Tools, and then install or update the
|
||||||
NDKs, tools and packages needed for development. For more information, see
|
necessary NDKs, tools, and packages. For more information, see
|
||||||
\l{Getting Started with Qt for Android}.
|
\l{Getting Started with Qt for Android}.
|
||||||
|
|
||||||
\section2 Viewing Android Tool Chain Settings
|
\section2 Viewing Android Tool Chain Settings
|
||||||
|
|
||||||
The Android SDK Command-Line Tools download URL, the essential
|
A JSON configuration file defines the Android SDK Command-Line Tools download
|
||||||
packages list, and the appropriate NDK for each Qt version are defined in a JSON
|
URL, the essential packages list, and the appropriate NDK for each Qt version.
|
||||||
configuration file. The file is located under the user's \QC
|
The file is in the \QC resource folder:
|
||||||
resource folder:
|
|
||||||
|
|
||||||
\badcode
|
\badcode
|
||||||
# Linux and macOS
|
# Linux and macOS
|
||||||
@@ -127,8 +124,8 @@
|
|||||||
C:\Users\Username\AppData\Local\QtProject\qtcreator\android\sdk_definitions.json
|
C:\Users\Username\AppData\Local\QtProject\qtcreator\android\sdk_definitions.json
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
For example, the SDK configuration file defines the NDK version 19.2.5345600
|
For example, the SDK configuration file sets the NDK version 19.2.5345600
|
||||||
to be used for Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1 versions:
|
for use with Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1:
|
||||||
|
|
||||||
\badcode
|
\badcode
|
||||||
"specific_qt_versions": [
|
"specific_qt_versions": [
|
||||||
@@ -150,10 +147,10 @@
|
|||||||
Linux or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices >
|
Linux or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices >
|
||||||
\uicontrol Android on \macos.
|
\uicontrol Android on \macos.
|
||||||
|
|
||||||
\image qtcreator-options-android-sdk-tools.png "Android NDK and SDK checks"
|
\image qtcreator-options-android-sdk-tools.png {Android NDK and SDK checks}
|
||||||
|
|
||||||
The locked versions were installed by the SDK Manager, and can only
|
The SDK Manager installed the locked items. You can modify them only
|
||||||
be modified from the \uicontrol {Android SDK Manager} dialog.
|
in the \uicontrol {Android SDK Manager} dialog.
|
||||||
For more information, see \l{Managing Android SDK Packages}.
|
For more information, see \l{Managing Android SDK Packages}.
|
||||||
|
|
||||||
To manually download NDKs, select \inlineimage icons/online.png
|
To manually download NDKs, select \inlineimage icons/online.png
|
||||||
@@ -173,7 +170,7 @@
|
|||||||
tool, \l {sdkmanager}, for SDK package management. To make SDK management
|
tool, \l {sdkmanager}, for SDK package management. To make SDK management
|
||||||
easier, \QC has an SDK Manager for
|
easier, \QC has an SDK Manager for
|
||||||
installing, updating, and removing SDK packages. You can still use
|
installing, updating, and removing SDK packages. You can still use
|
||||||
sdkmanager for advanced SDK management.
|
\c sdkmanager for advanced SDK management.
|
||||||
|
|
||||||
To view the installed Android SDK packages, select \uicontrol Edit >
|
To view the installed Android SDK packages, select \uicontrol Edit >
|
||||||
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android >
|
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android >
|
||||||
@@ -181,7 +178,7 @@
|
|||||||
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android >
|
\uicontrol Preferences > \uicontrol Devices > \uicontrol Android >
|
||||||
\uicontrol {SDK Manager} on \macos.
|
\uicontrol {SDK Manager} on \macos.
|
||||||
|
|
||||||
\image qtcreator-android-sdk-manager.png "Android SDK Manager"
|
\image qtcreator-android-sdk-manager.webp {Android SDK Manager}
|
||||||
|
|
||||||
You can show packages for the release channel you select in
|
You can show packages for the release channel you select in
|
||||||
\uicontrol {Show Packages} > \uicontrol Channel. Common channel IDs include
|
\uicontrol {Show Packages} > \uicontrol Channel. Common channel IDs include
|
||||||
@@ -194,27 +191,27 @@
|
|||||||
\uicontrol {Update Installed}. Select the packages to update, and then
|
\uicontrol {Update Installed}. Select the packages to update, and then
|
||||||
select \uicontrol Apply.
|
select \uicontrol Apply.
|
||||||
|
|
||||||
To specify advanced sdkmanager settings, select
|
To specify advanced \c sdkmanager settings, select
|
||||||
\uicontrol {Advanced Options} and enter arguments in the
|
\uicontrol {Advanced Options} and enter arguments in the
|
||||||
\uicontrol {SDK Manager arguments} field. The available arguments are listed
|
\uicontrol {SDK Manager arguments} field. \uicontrol {Available arguments}
|
||||||
and described in \uicontrol {Available arguments}.
|
lists the arguments with descriptions.
|
||||||
|
|
||||||
\image qtcreator-android-sdk-manager-arguments.png "Android SDK Manager Arguments dialog"
|
\image qtcreator-android-sdk-manager-arguments.png {Android SDK Manager Arguments dialog}
|
||||||
|
|
||||||
\section1 Managing Android Virtual Devices (AVD)
|
\section1 Managing Android Virtual Devices (AVD)
|
||||||
|
|
||||||
The available AVDs are listed in \uicontrol Edit > \uicontrol Preferences
|
To view the available AVDs, select \uicontrol Edit > \uicontrol Preferences
|
||||||
> \uicontrol Devices on Windows and Linux or \uicontrol {\QC} >
|
> \uicontrol Devices on Windows and Linux or \uicontrol {\QC} >
|
||||||
\uicontrol Preferences > \uicontrol Devices > on \macos. You can add more
|
\uicontrol Preferences > \uicontrol Devices > on \macos. You can add more
|
||||||
AVDs.
|
AVDs.
|
||||||
|
|
||||||
\image qtcreator-android-avd-manager.png "Android device in Devices"
|
\image qtcreator-android-avd-manager.png {Android device in Devices}
|
||||||
|
|
||||||
You can see the status of the selected device in \uicontrol {Current state}.
|
You can see the status of the selected device in \uicontrol {Current state}.
|
||||||
To update the status information, select \uicontrol Refresh.
|
To update the status information, select \uicontrol Refresh.
|
||||||
|
|
||||||
To start an AVD, select \uicontrol {Start AVD}. Usually, you don't need to
|
To start an AVD, select \uicontrol {Start AVD}. Usually, you don't need to
|
||||||
start AVDs separately because they are automatically started when you
|
start AVDs separately because \QC starts them when you
|
||||||
select them in the \l{Building for Multiple Platforms}{kit selector} to
|
select them in the \l{Building for Multiple Platforms}{kit selector} to
|
||||||
\l{Deploying to Android}{deploy applications} to them.
|
\l{Deploying to Android}{deploy applications} to them.
|
||||||
|
|
||||||
@@ -223,7 +220,7 @@
|
|||||||
|
|
||||||
To specify options for starting an AVD, select \uicontrol {AVD Arguments}.
|
To specify options for starting an AVD, select \uicontrol {AVD Arguments}.
|
||||||
|
|
||||||
\image qtcreator-android-avd-arguments.png "Startup options for AVDs"
|
\image qtcreator-android-avd-arguments.png {Startup options for AVDs}
|
||||||
|
|
||||||
Specify the options in \uicontrol {Emulator command-line startup options}.
|
Specify the options in \uicontrol {Emulator command-line startup options}.
|
||||||
For available options, see \l{Start the emulator from the command line}.
|
For available options, see \l{Start the emulator from the command line}.
|
||||||
@@ -247,7 +244,7 @@
|
|||||||
or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices >
|
or \uicontrol {\QC} > \uicontrol Preferences > \uicontrol Devices >
|
||||||
\uicontrol Add > \uicontrol {Android Device} on \macos to open the
|
\uicontrol Add > \uicontrol {Android Device} on \macos to open the
|
||||||
\uicontrol {Create New AVD} dialog.
|
\uicontrol {Create New AVD} dialog.
|
||||||
\image qtcreator-android-create-avd.png "Create New AVD dialog"
|
\image qtcreator-android-create-avd.png {Create New AVD dialog}
|
||||||
\li Set the name, definition, architecture, target API level, and
|
\li Set the name, definition, architecture, target API level, and
|
||||||
SD card size of the device.
|
SD card size of the device.
|
||||||
\li Select \uicontrol OK to create the AVD.
|
\li Select \uicontrol OK to create the AVD.
|
||||||
@@ -258,9 +255,9 @@
|
|||||||
|
|
||||||
\section1 Debugging on Android Devices
|
\section1 Debugging on Android Devices
|
||||||
|
|
||||||
Debugging is enabled in different ways on different Android devices.
|
You enable debugging in different ways on different Android devices.
|
||||||
Look for \uicontrol {USB Debugging} under \uicontrol {Developer Options}. On
|
Look for \uicontrol {USB Debugging} under \uicontrol {Developer Options}. On
|
||||||
some devices \uicontrol {Developer Options} is hidden and becomes visible
|
some devices, \uicontrol {Developer Options} is hidden and becomes visible
|
||||||
only when you tap the \uicontrol {Build number} field in \uicontrol Settings
|
only when you tap the \uicontrol {Build number} field in \uicontrol Settings
|
||||||
> \uicontrol About several times. For more information, see
|
> \uicontrol About several times. For more information, see
|
||||||
\l {Configure on-device developer options}.
|
\l {Configure on-device developer options}.
|
||||||
@@ -269,7 +266,7 @@
|
|||||||
the application for debugging.
|
the application for debugging.
|
||||||
|
|
||||||
\note \QC cannot debug applications on Android devices if Android Studio is
|
\note \QC cannot debug applications on Android devices if Android Studio is
|
||||||
running. If the following message is displayed in \l {Application Output},
|
running. If the following message appears in \l {Application Output},
|
||||||
close Android Studio and try again:
|
close Android Studio and try again:
|
||||||
|
|
||||||
\badcode
|
\badcode
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -8,24 +8,25 @@
|
|||||||
|
|
||||||
\title Deploying to Android
|
\title Deploying to Android
|
||||||
|
|
||||||
On Android, applications are distributed in specially structured types of
|
Android applications are packaged as ZIP files called Application Packages
|
||||||
ZIP packages called Application Packages (APK) or Android App Bundles (AAB).
|
(APK) or Android App Bundles (AAB). You can install and run APK files on a
|
||||||
APK files can be downloaded to and executed on a device, whereas AAB is
|
device. You can upload AAB files to the Google Play store.
|
||||||
intended to be interpreted by the Google Play store and is used to generate
|
|
||||||
APK files.
|
|
||||||
|
|
||||||
\l{Qt for Android} has binaries for armv7a, arm64-v8a, x86, and x86-64.
|
\l{Qt for Android} has binaries for armv7a, arm64-v8a, x86, and x86-64.
|
||||||
To support several different ABIs in your application, build an AAB that
|
To support several different ABIs in your application, build an AAB that
|
||||||
has binaries for each of the ABIs. The Google Play store uses the
|
has binaries for each of the ABIs. The Google Play store uses the AAB
|
||||||
AAB to generate optimized APK packages for the devices issuing the download
|
to generate optimized APK packages for the devices that request download
|
||||||
request and automatically signs them with your publisher key.
|
and automatically signs them with your publisher key.
|
||||||
|
|
||||||
\QC supports the following methods of deployment for Android applications:
|
\QC supports the following methods of deployment for Android applications:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li As a stand-alone, distributable application package (APK).
|
\li As a stand-alone, distributable application package (APK).
|
||||||
\li Since Qt 5.14.0, as an app bundle (AAB), intended for distribution
|
\li As an app bundle (AAB) for distribution in the Google Play store.
|
||||||
in the Google Play store.
|
|
||||||
|
All Qt versions do not support AABs. Qt 6.3.0 and later support
|
||||||
|
multi-abi builds for applications that you build with CMake. For
|
||||||
|
more information, see \l{Qt for Android - Building User Projects}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\note Since \QC 4.12, Ministro is not supported.
|
\note Since \QC 4.12, Ministro is not supported.
|
||||||
@@ -39,56 +40,27 @@
|
|||||||
|
|
||||||
\section1 Packaging Applications
|
\section1 Packaging Applications
|
||||||
|
|
||||||
Because bundling applications as APK packages is not
|
Because bundling applications as APK packages is not trivial, Qt has the
|
||||||
trivial, Qt 5 has a deployment tool called \c androiddeployqt.
|
\l {The androiddeployqt Tool}{androiddeployqt} tool. When you deploy an
|
||||||
When you deploy an application using a \e {Qt for Android kit}, \QC uses
|
application using a \e {Qt for Android kit}, \QC runs the tool to
|
||||||
the \c androiddeployqt tool to create the necessary files and to bundle them
|
create the necessary files and to bundle them into an APK. For more
|
||||||
into an APK:
|
information, see \l{Android Package Templates}.
|
||||||
|
|
||||||
\list
|
|
||||||
|
|
||||||
\li Java files, which serve as the entry point into your application and
|
|
||||||
that automatically load Qt and execute the native code in your
|
|
||||||
application.
|
|
||||||
|
|
||||||
\li AndroidManifest.xml, which has meta-information about your
|
|
||||||
application.
|
|
||||||
|
|
||||||
\li Other XML files, which specify the dependencies of your application.
|
|
||||||
|
|
||||||
\li Resource files.
|
|
||||||
|
|
||||||
\li Libraries and QML files, which can be included in the project
|
|
||||||
depending on the deployment method that you select.
|
|
||||||
|
|
||||||
\li Gradle wrappers that are needed to download and use Gradle.
|
|
||||||
|
|
||||||
\li Gradle script that is needed by Java IDEs, such as Android Studio.
|
|
||||||
It allows the user to extend the Java part without copying our Java
|
|
||||||
sources. It also allows the IDEs to offer code completion, syntax
|
|
||||||
highlighting, and so on.
|
|
||||||
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
The Gradle wrappers and scripts are bundled only if you use Gradle to build
|
|
||||||
the application packages. For more information, see
|
|
||||||
\l{Connecting Android Devices}.
|
|
||||||
|
|
||||||
To view the packages that the \c androiddeployqt tool created, select the
|
To view the packages that the \c androiddeployqt tool created, select the
|
||||||
\uicontrol {Open package location after build} check box.
|
\uicontrol {Open package location after build} check box.
|
||||||
|
|
||||||
\section2 Specifying Deployment Settings
|
\section2 Specifying Deployment Settings
|
||||||
|
|
||||||
The available deployment settings are listed in the \uicontrol Method field.
|
The \uicontrol Method field lists deployment settings.
|
||||||
To add deployment methods for a project, select \uicontrol Add.
|
To add deployment methods for a project, select \uicontrol Add.
|
||||||
|
|
||||||
\image qtcreator-android-deployment-settings.png "Deployment settings"
|
\image qtcreator-android-deployment-settings.png {Deployment settings}
|
||||||
|
|
||||||
To rename the current deployment method, select \uicontrol Rename.
|
To rename the current deployment method, select \uicontrol Rename.
|
||||||
|
|
||||||
To remove the current deployment method, select \uicontrol Remove.
|
To remove the current deployment method, select \uicontrol Remove.
|
||||||
|
|
||||||
The packages are deployed on the Android device that you select in the
|
\QC deploys the packages on the Android device that you select in the
|
||||||
\l{Building for Multiple Platforms}{kit selector}. To add devices, select
|
\l{Building for Multiple Platforms}{kit selector}. To add devices, select
|
||||||
\uicontrol Manage.
|
\uicontrol Manage.
|
||||||
|
|
||||||
@@ -107,14 +79,13 @@
|
|||||||
\uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build >
|
\uicontrol Projects > \uicontrol {Build & Run} > \uicontrol Build >
|
||||||
\uicontrol {Build Android APK} > \uicontrol Details.
|
\uicontrol {Build Android APK} > \uicontrol Details.
|
||||||
|
|
||||||
\image qtcreator-android-build-apk-step.png "Build Android APK step"
|
\image qtcreator-build-settings-android-apk.webp {Build Android APK step}
|
||||||
|
|
||||||
The \c androiddeployqt tool uses the configuration information to
|
The \c androiddeployqt tool create APKs based on the settings. For more
|
||||||
create APKs. For more information about the available options, see
|
information about the available options, see \l{androiddeployqt}.
|
||||||
\l{androiddeployqt}.
|
|
||||||
|
|
||||||
You can view information about what the \c androiddeployqt tool is doing in
|
You can view information about what the \c androiddeployqt tool is doing in
|
||||||
\l {Compile Output}. To view additional information, select the
|
\l {Compile Output}. To view more information, select the
|
||||||
\uicontrol {Verbose output} check box.
|
\uicontrol {Verbose output} check box.
|
||||||
|
|
||||||
Select \uicontrol {Add debug server} to include the debug server binary
|
Select \uicontrol {Add debug server} to include the debug server binary
|
||||||
@@ -122,36 +93,31 @@
|
|||||||
|
|
||||||
\section3 Selecting API Level
|
\section3 Selecting API Level
|
||||||
|
|
||||||
In the \uicontrol {Android build platform SDK} field, you can select the
|
In the \uicontrol {Android build platform SDK} field, select the
|
||||||
API level to use for building the application. Usually, you should select
|
\l{What is API Level?}{API level} to use for building the application.
|
||||||
the highest API level available.
|
Usually, you should select the highest API level available.
|
||||||
|
|
||||||
\note For Qt 5.12.0 to 5.12.5 and Qt 5.13.0 to 5.13.1, Android build
|
Usually, you should use the highest version of the Android SDK
|
||||||
platform SDK 28 should be used. For more recent versions than Qt 5.13.1,
|
build-tools for building. If necessary, select another version
|
||||||
build platform SDK 29 or the most recent one should be used.
|
in the \uicontrol {Android build-tools version} field.
|
||||||
|
|
||||||
This field does not specify the minimum supported API level nor the target
|
|
||||||
API level, which you can specify in the Android manifest. See
|
|
||||||
\l{Editing Manifest Files}. For more information about Android API levels, see
|
|
||||||
\l{What is API Level?}.
|
|
||||||
|
|
||||||
\section3 Building AABs
|
\section3 Building AABs
|
||||||
|
|
||||||
For testing the application locally, use the APK format because
|
For testing the application locally, use the APK format because
|
||||||
the package can be uploaded directly to the device and run. For
|
\QC can install and run the package on the device. For distribution
|
||||||
distribution to the Google Play store, create an AAB by selecting
|
to the Google Play store, create an AAB by selecting
|
||||||
the \uicontrol {Build Android App Bundle (*.aab)} check box.
|
the \uicontrol {Build Android App Bundle (*.aab)} check box.
|
||||||
|
|
||||||
When building with CMake, you can view the selected ABIs in
|
When building with CMake, you can view the selected ABIs in
|
||||||
\uicontrol {Initial Configuration} in the \uicontrol CMake section.
|
\uicontrol {Initial Configuration} in the \uicontrol CMake section.
|
||||||
You can set additional ABIs as values of the \c ANDROID_ABI key:
|
You can set additional ABIs as values of the \c ANDROID_ABI key:
|
||||||
|
|
||||||
\image qtcreator-android-cmake-settings.png "CMake settings for building AABs"
|
\image qtcreator-android-cmake-settings.png {CMake settings for building AABs}
|
||||||
|
|
||||||
When building with Qbs or qmake, you can select the ABIs in the
|
When building with Qbs or qmake, you can select the ABIs in the
|
||||||
\uicontrol ABIs field in the \uicontrol {Build Steps}:
|
\uicontrol ABIs field in the \uicontrol {Build Steps}:
|
||||||
|
|
||||||
\image qtcreator-android-build-steps.png "qmake settings for building AABs"
|
\image qtcreator-android-build-steps.png {qmake settings for building AABs}
|
||||||
|
|
||||||
\section3 Signing Android Packages
|
\section3 Signing Android Packages
|
||||||
|
|
||||||
@@ -174,12 +140,12 @@
|
|||||||
certificate has information about the algorithm that is used to sign
|
certificate has information about the algorithm that is used to sign
|
||||||
the certificate, as well as the signature of the certificate.
|
the certificate, as well as the signature of the certificate.
|
||||||
|
|
||||||
The keystore is protected by a password. In addition, you can protect each
|
A password protects the keystore. In addition, you can protect each
|
||||||
alias with its individual password.
|
alias with its individual password.
|
||||||
|
|
||||||
When you sign an Android application, you must select a keystore that
|
When you sign an Android application, you must select a keystore that
|
||||||
has certificates and a certificate alias from the keystore. The public
|
has certificates and a certificate alias from the keystore. The signing
|
||||||
key (certificate) for the alias is embedded into the APK during signing.
|
process embeds the public key (certificate) for the alias into the APK.
|
||||||
|
|
||||||
To create a keystore and a self-signed certificate:
|
To create a keystore and a self-signed certificate:
|
||||||
|
|
||||||
@@ -250,8 +216,92 @@
|
|||||||
You can use the configuration options to specify all the settings you need
|
You can use the configuration options to specify all the settings you need
|
||||||
for the \c androiddeployqt tool. You only need an Android manifest file
|
for the \c androiddeployqt tool. You only need an Android manifest file
|
||||||
to specify Android-specific settings, such as the application icon.
|
to specify Android-specific settings, such as the application icon.
|
||||||
However, the manifest file is needed when you want to publish the package
|
However, you need the manifest file to publish the package in the Play Store.
|
||||||
in the Play Store.
|
For more information about manifest files, see
|
||||||
|
\l {Qt Android Manifest File Configuration}.
|
||||||
|
|
||||||
|
If you use CMake as the build system, you must specify the Android package
|
||||||
|
source directory, \c QT_ANDROID_PACKAGE_SOURCE_DIR, in the CMakeList.txt
|
||||||
|
file, as instructed in the \l{Locking Device Orientation}
|
||||||
|
{mobile device tutorial}.
|
||||||
|
|
||||||
|
To use \QC to create an Android manifest file and to open it in the Android
|
||||||
|
Manifest Editor:
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\li Select \uicontrol Projects > \uicontrol Build >
|
||||||
|
\uicontrol {Build Android APK} > \uicontrol {Create Templates}.
|
||||||
|
|
||||||
|
\li Check the path in \uicontrol {Android package source directory}.
|
||||||
|
|
||||||
|
\image qtcreator-android-create-template.png {Create Template dialog}
|
||||||
|
|
||||||
|
\li Select \uicontrol {Copy the Gradle files to Android directory} if you
|
||||||
|
plan to extend the Java part of your Qt application.
|
||||||
|
|
||||||
|
\li Select \uicontrol Finish to copy the template files to the \c android
|
||||||
|
directory and to open the manifest file for editing.
|
||||||
|
|
||||||
|
\image qtcreator-android-manifest-editor-package.webp {Package info in Android Manifest Editor}
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
The following table summarizes the options you can set.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header
|
||||||
|
\li Option
|
||||||
|
\li Value
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Package name}
|
||||||
|
\li A valid \l{Package Names}{package name} for the application.
|
||||||
|
For example, \c {org.example.myapplication}.
|
||||||
|
An automatically generated Java launcher that is packaged with the
|
||||||
|
application into an APK launches the application.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Version code}
|
||||||
|
\li An internal version number for the package that determines whether
|
||||||
|
one version of the application is more recent than another.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Version name}
|
||||||
|
\li The version number that is visible to users.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Minimum required SDK}
|
||||||
|
\li The minimum API level required to run the application if you set it
|
||||||
|
manually in the manifest file.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Target SDK}
|
||||||
|
\li The targeted API level of the application if you set it manually in
|
||||||
|
the manifest file.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Application name}
|
||||||
|
\li The application's name.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Activity name}
|
||||||
|
\li An activity name.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Style extraction}
|
||||||
|
\li The method that Qt uses to determine which \l{Styling}{UI style}
|
||||||
|
to use.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Screen orientation}
|
||||||
|
\li How to determine \l{Screen Orientation}{screen orientation}.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Application icon}
|
||||||
|
\li Images to use as \l{Icons}{application icons} depending on screen
|
||||||
|
resolution.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Splash screen}
|
||||||
|
\li Images to display as \l{Splash Screens}{splash screens} depending on
|
||||||
|
the screen orientation and resolution.
|
||||||
|
\row
|
||||||
|
\li \uicontrol Permissions
|
||||||
|
\li The \l{Setting Permissions}{permissions} that the application needs.
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
On the top header, select the \uicontrol {XML Source} tab to edit the file
|
||||||
|
in XML format.
|
||||||
|
|
||||||
\section2 Package Names
|
\section2 Package Names
|
||||||
|
|
||||||
@@ -378,7 +428,7 @@
|
|||||||
\li Locks the orientation to its current rotation, whatever that is.
|
\li Locks the orientation to its current rotation, whatever that is.
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
\section2 Icons and Splash Screens
|
\section2 Icons
|
||||||
|
|
||||||
You can set different images to be shown as application icons and splash
|
You can set different images to be shown as application icons and splash
|
||||||
screens on low, medium, high, and extra high DPI displays. The following
|
screens on low, medium, high, and extra high DPI displays. The following
|
||||||
@@ -399,16 +449,17 @@
|
|||||||
high, and extra high DPI displays, as needed. Alternatively, set the icons
|
high, and extra high DPI displays, as needed. Alternatively, set the icons
|
||||||
for each resolution separately.
|
for each resolution separately.
|
||||||
|
|
||||||
\image qtcreator-android-manifest-editor-app-icon.png "Application icons in Android Manifest Editor"
|
\image qtcreator-android-manifest-editor-app-icon.webp {Application icons in Android Manifest Editor}
|
||||||
|
|
||||||
|
\section2 Splash Screens
|
||||||
|
|
||||||
Specify settings for splash screens in the \uicontrol {Splash screen} tab.
|
Specify settings for splash screens in the \uicontrol {Splash screen} tab.
|
||||||
Select images to display as splash screens depending on the device
|
Select images to display as splash screens depending on the device
|
||||||
orientation and screen resolution.
|
orientation and screen resolution.
|
||||||
|
|
||||||
\image qtcreator-android-manifest-editor-splash-screen.png "Splash screens in Android Manifest Editor"
|
\image qtcreator-android-manifest-editor-splash-screen.webp {Splash screens in Android Manifest Editor}
|
||||||
|
|
||||||
By default, the splash screen is hidden automatically
|
By default, drawing an activity hides the splash screen. To keep it visible until
|
||||||
when an activity is drawn. To keep it visible until
|
|
||||||
\l{https://doc.qt.io/qt-6/qnativeinterface-qandroidapplication.html#hideSplashScreen}
|
\l{https://doc.qt.io/qt-6/qnativeinterface-qandroidapplication.html#hideSplashScreen}
|
||||||
{QNativeInterface::QAndroidApplication::hideSplashScreen()} is
|
{QNativeInterface::QAndroidApplication::hideSplashScreen()} is
|
||||||
called, select the \uicontrol {Sticky splash screen} check box.
|
called, select the \uicontrol {Sticky splash screen} check box.
|
||||||
@@ -424,102 +475,22 @@
|
|||||||
|
|
||||||
Select \uicontrol {Clear All} to reset all settings or remove all images.
|
Select \uicontrol {Clear All} to reset all settings or remove all images.
|
||||||
|
|
||||||
\section2 Android Manifest Editor
|
\section2 Setting Permissions
|
||||||
|
|
||||||
If you use qmake as the build system, you can create an Android manifest
|
Starting from Android 6.0 (API 23), applications have to request permissions
|
||||||
file and edit it in \QC.
|
at runtime (see \l{QtAndroidPrivate::requestPermission()}). For
|
||||||
|
lower Android API levels, users have to grant the permissions when they
|
||||||
To create an Android manifest file and to open it in the Android Manifest
|
|
||||||
Editor:
|
|
||||||
|
|
||||||
\list 1
|
|
||||||
|
|
||||||
\li Select \uicontrol Projects > \uicontrol Build >
|
|
||||||
\uicontrol {Build Android APK} > \uicontrol {Create Templates}.
|
|
||||||
|
|
||||||
\li Check the path in \uicontrol {Android package source directory}.
|
|
||||||
|
|
||||||
\image qtcreator-android-create-template.png "Create Template dialog"
|
|
||||||
|
|
||||||
\li Select \uicontrol {Copy the Gradle files to Android directory} if you
|
|
||||||
plan to extend the Java part of your Qt application.
|
|
||||||
|
|
||||||
\li Select \uicontrol Finish to copy the template files to the \c android
|
|
||||||
directory and to open the manifest file for editing.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Package name} field, enter a valid
|
|
||||||
\l{Package Names}{package name} for the application.
|
|
||||||
For example, \c {org.example.myapplication}.
|
|
||||||
The application is launched by an automatically generated Java launcher
|
|
||||||
that is packaged with the application into an Android package (.apk).
|
|
||||||
|
|
||||||
\image qtcreator-android-manifest-editor-package.png "Package info in Android Manifest Editor"
|
|
||||||
|
|
||||||
\li You can specify an internal version number for the package in the
|
|
||||||
\uicontrol {Version code} field. It is used to determine whether one version of
|
|
||||||
the application is more recent than another. In the \uicontrol {Version name}
|
|
||||||
field, specify the version number that is shown to users.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Minimum required SDK} field, select the minimum API level
|
|
||||||
required to run the application. The minimum supported API level for \QC is
|
|
||||||
android-9. However, Qt versions might have different minimum API levels, and
|
|
||||||
therefore \QC does not allow you to select an API level that the Qt version
|
|
||||||
specified for the kit does not support.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Target SDK} field, select the targeted API level of the
|
|
||||||
application. This affects the activation of some compatibility features in
|
|
||||||
the OS. The value used by the \c androiddeployqt tool by default is 14, which
|
|
||||||
means that the overflow button in the system navigation bar will not be
|
|
||||||
enabled by default.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Application name} field, set the application's name.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Activity name} field, set an activity name.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Style extraction} field, set the method that Qt
|
|
||||||
uses to \l{Styling}{determine which UI style to use}.
|
|
||||||
|
|
||||||
\li In the \uicontrol {Screen orientation} field, select the option for
|
|
||||||
determining \l{Screen Orientation}{screen orientation}.
|
|
||||||
|
|
||||||
\li In \uicontrol {Application icon}, specify images to use as application
|
|
||||||
icons depending on screen resolution.
|
|
||||||
|
|
||||||
\li In \uicontrol {Splash screen}, select images to display as splash
|
|
||||||
screens depending on the screen orientation and resolution.
|
|
||||||
|
|
||||||
\li In \uicontrol {Android services}, select \uicontrol Add to add a service.
|
|
||||||
You must enter at least a service class name for a new service. If you select
|
|
||||||
\uicontrol {Run in external process}, you also need to enter a process name.
|
|
||||||
If you select \uicontrol {Run in external library}, you need to enter a library name.
|
|
||||||
Service arguments are mandatory for a service that is not run in an external
|
|
||||||
library. For more information about writing service code and structure of services,
|
|
||||||
see \l{Android Services}.
|
|
||||||
|
|
||||||
\image qtcreator-android-manifest-editor-services.png "Android services in Android Manifest Editor"
|
|
||||||
|
|
||||||
\li In the \uicontrol Permissions field, you can specify the permissions that your
|
|
||||||
application needs. Starting from Android 6.0 (API 23), permissions have to be
|
|
||||||
requested at runtime (see \l{QtAndroidPrivate::requestPermission()}). For
|
|
||||||
lower Android API levels, users are asked to grant the permissions when they
|
|
||||||
install the application. Android OS then grants the application access to the
|
install the application. Android OS then grants the application access to the
|
||||||
appropriate data and features.
|
appropriate data and features.
|
||||||
|
|
||||||
\image qtcreator-android-manifest-editor-permissions.png "Permissions in Android Manifest Editor"
|
\image qtcreator-android-manifest-editor-permissions.webp {Permissions in Android Manifest Editor}
|
||||||
|
|
||||||
\li Select the \uicontrol {Include default permissions for Qt modules} and
|
Select the \uicontrol {Include default permissions for Qt modules} and
|
||||||
\uicontrol {Include default features for Qt modules} check boxes to add the
|
\uicontrol {Include default features for Qt modules} check boxes to add the
|
||||||
permissions needed by Qt libraries. This can be
|
permissions needed by Qt libraries. This can be
|
||||||
\c {android.permission.WRITE_EXTERNAL_STORAGE} for \l{Qt Core} or
|
\c {android.permission.WRITE_EXTERNAL_STORAGE} for \l{Qt Core} or
|
||||||
\c {android.permission.ACCESS_COARSE_LOCATION} for
|
\c {android.permission.ACCESS_BACKGROUND_LOCATION} for \l{Qt Positioning}.
|
||||||
\l{https://doc.qt.io/qt-5.15/qtlocation-index.html}{Qt Location}.
|
|
||||||
|
|
||||||
\li To add a permission, select it from the list, and then click \uicontrol Add.
|
|
||||||
|
|
||||||
\endlist
|
|
||||||
|
|
||||||
On the top header, select the \uicontrol {XML Source} tab to edit the file
|
|
||||||
in XML format.
|
|
||||||
|
|
||||||
|
To add a permission, select it from the list, and then click \uicontrol Add.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
\title Viewing Call Stack Trace
|
\title Viewing Call Stack Trace
|
||||||
|
|
||||||
When the program being debugged is interrupted, \QC displays the nested
|
When the application being debugged is interrupted, \QC displays the nested
|
||||||
function calls leading to the current position as a call stack trace. This
|
function calls leading to the current position as a call stack trace. This
|
||||||
stack trace is built up from call stack frames, each representing a
|
stack trace is built up from call stack frames, each representing a
|
||||||
particular function. For each function, \QC tries to retrieve the file name
|
particular function. For each function, \QC tries to retrieve the file name
|
||||||
@@ -24,14 +24,17 @@
|
|||||||
Since the call stack leading to the current position may originate or go
|
Since the call stack leading to the current position may originate or go
|
||||||
through code for which no debug information is available, not all stack
|
through code for which no debug information is available, not all stack
|
||||||
frames have corresponding source locations. Stack frames without
|
frames have corresponding source locations. Stack frames without
|
||||||
corresponding source locations are grayed out in the \uicontrol Stack view.
|
corresponding source locations are grayed out.
|
||||||
|
|
||||||
If you click a frame with a known source location, the text editor jumps to
|
If you click a frame with a known source location, the text editor jumps to
|
||||||
the corresponding location and updates the \uicontrol {Locals} and
|
the corresponding location and updates the
|
||||||
\uicontrol {Expressions} views, making it seem like the program
|
\l {Local Variables and Function Parameters}{Locals} and
|
||||||
was interrupted before entering the function.
|
\l {Evaluating Expressions}{Expressions} views, making it seem like the
|
||||||
|
application was interrupted before entering the function.
|
||||||
|
|
||||||
To find out which QML file is causing a Qt Quick 2 application to crash,
|
\section1 Loading QML Stack
|
||||||
|
|
||||||
|
To find out which QML file is causing a Qt Quick application to crash,
|
||||||
select \uicontrol {Load QML Stack} in the context menu in the
|
select \uicontrol {Load QML Stack} in the context menu in the
|
||||||
\uicontrol Stack view. The debugger tries to retrieve the JavaScript stack
|
\uicontrol Stack view. The debugger tries to retrieve the JavaScript stack
|
||||||
from the stopped executable and prepends the frames to the C++ frames,
|
from the stopped executable and prepends the frames to the C++ frames,
|
||||||
@@ -66,8 +69,8 @@
|
|||||||
|
|
||||||
\li Executing some system calls
|
\li Executing some system calls
|
||||||
|
|
||||||
\li Changes in a block of memory at a particular address when a
|
\li Changes in a block of memory at a particular address when an
|
||||||
program is running
|
application is running
|
||||||
|
|
||||||
\li Emitting QML signals
|
\li Emitting QML signals
|
||||||
|
|
||||||
@@ -75,26 +78,30 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The interruption of a program by a breakpoint can be restricted with certain
|
A breakpoint interrupts the application every time the application reaches
|
||||||
conditions.
|
its location unless you specify a boolean condition for it. The breakpoint
|
||||||
|
evaluates the expression each time the application passes it, and the
|
||||||
|
application stops only if the condition evaluates to \c true.
|
||||||
|
|
||||||
|
\section1 Unclaimed and Claimed Breakpoints
|
||||||
|
|
||||||
Breakpoints come in two varieties: \c unclaimed and \c claimed.
|
Breakpoints come in two varieties: \c unclaimed and \c claimed.
|
||||||
An unclaimed breakpoint represents a task to interrupt the debugged
|
An unclaimed breakpoint represents a task to interrupt the debugged
|
||||||
program and passes the control to you later. It has two states:
|
application and passes the control to you later. It has two states:
|
||||||
\c pending and \c implanted.
|
\c pending and \c implanted.
|
||||||
|
|
||||||
Unclaimed breakpoints are stored as a part of a session and exist
|
Unclaimed breakpoints are stored as a part of a session and exist
|
||||||
independently of whether a program is being debugged or not. They
|
independently of whether an application is being debugged or not. They
|
||||||
are listed in the \uicontrol {Breakpoint Preset} view and in the
|
are listed in the \uicontrol {Breakpoint Preset} view and in the
|
||||||
editor using the \inlineimage icons/qtcreator-unclaimed-breakpoint-icon.png
|
editor using the \inlineimage icons/qtcreator-unclaimed-breakpoint-icon.png
|
||||||
(\uicontrol {Unclaimed Breakpoint}) icon, when they refer to a position
|
(\uicontrol {Unclaimed Breakpoint}) icon, when they refer to a position
|
||||||
in code.
|
in code.
|
||||||
|
|
||||||
\image qtcreator-debugger-breakpoint-preset.png {Breakpoint Preset view}
|
\image qtcreator-debugger-breakpoint-preset.webp {Breakpoint Preset view}
|
||||||
|
|
||||||
When a debugger starts, the debugging backend identifies breakpoints
|
When a debugger starts, the debugging backend identifies breakpoints
|
||||||
from the set of unclaimed breakpoints that might be handled by the
|
from the set of unclaimed breakpoints that might be handled by the
|
||||||
debugged program and claims them for its own exclusive use. Claimed
|
debugged application and claims them for its own exclusive use. Claimed
|
||||||
breakpoints are listed in the \uicontrol {Breakpoints} view of the
|
breakpoints are listed in the \uicontrol {Breakpoints} view of the
|
||||||
running debugger. This view only exists while the debugger is running.
|
running debugger. This view only exists while the debugger is running.
|
||||||
|
|
||||||
@@ -115,11 +122,11 @@
|
|||||||
\uicontrol{Breakpoint Preset} view.
|
\uicontrol{Breakpoint Preset} view.
|
||||||
|
|
||||||
When an implanted breakpoint is hit during the execution of the
|
When an implanted breakpoint is hit during the execution of the
|
||||||
debugged program, control is passed back to you.
|
debugged application, control is passed back to you.
|
||||||
You can then examine the state of the interrupted program, or
|
You can then examine the state of the interrupted application, or
|
||||||
continue execution either line-by-line or continuously.
|
continue execution either line-by-line or continuously.
|
||||||
|
|
||||||
\image qtcreator-debug-breakpoints.png "Breakpoints view"
|
\image qtcreator-debug-breakpoints.webp {Breakpoints view}
|
||||||
|
|
||||||
\section1 Adding Breakpoints
|
\section1 Adding Breakpoints
|
||||||
|
|
||||||
@@ -133,7 +140,7 @@
|
|||||||
|
|
||||||
\li In the code editor, click the left margin or press \key F9
|
\li In the code editor, click the left margin or press \key F9
|
||||||
(\key F8 on \macos) on a particular line you want the
|
(\key F8 on \macos) on a particular line you want the
|
||||||
program to stop.
|
application to stop.
|
||||||
|
|
||||||
\li In the \uicontrol {Breakpoint Preset} view or the
|
\li In the \uicontrol {Breakpoint Preset} view or the
|
||||||
\uicontrol Breakpoints view:
|
\uicontrol Breakpoints view:
|
||||||
@@ -146,24 +153,68 @@
|
|||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\li In the \uicontrol {Breakpoint type} field, select the location in the
|
\li In the \uicontrol {Breakpoint type} field, select the location in the
|
||||||
program code where you want the program to stop. The other options
|
application code where you want the application to stop.
|
||||||
to specify depend on the selected location.
|
|
||||||
|
|
||||||
\image qtcreator-add-breakpoint.png "Add Breakpoints" dialog
|
|
||||||
|
|
||||||
\li In the \uicontrol Condition field, set the condition to be evaluated
|
|
||||||
before stopping at the breakpoint if the condition evaluates as
|
|
||||||
true.
|
|
||||||
|
|
||||||
\li In the \uicontrol Ignore field, specify the number of times that the
|
|
||||||
breakpoint is ignored before the program stops.
|
|
||||||
|
|
||||||
\li In the \uicontrol Commands field, specify the commands to execute
|
|
||||||
when the program stops; one command on a line. GDB executes the
|
|
||||||
commands in the order in which they are specified.
|
|
||||||
|
|
||||||
|
\image qtcreator-add-breakpoint.webp {Add Breakpoints} dialog
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
Deselect the \uicontrol Enabled check box to make the breakpoint temporarily
|
||||||
|
inoperative as if you had deleted it, but keep the information about the
|
||||||
|
breakpoint, so that you can enable it again later.
|
||||||
|
|
||||||
|
The other options to specify depend on the location you select, such as file
|
||||||
|
name and line number, address, expression, or function name. The following
|
||||||
|
table summarizes the advanced options.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header
|
||||||
|
\li Option
|
||||||
|
\li Value
|
||||||
|
\row
|
||||||
|
\li \uicontrol Condition
|
||||||
|
\li The condition to evaluate before stopping at the breakpoint if the
|
||||||
|
condition evaluates as \c true.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Ignore count}
|
||||||
|
\li The number of times to ignore the breakpoint before the application
|
||||||
|
stops.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Thread specification}
|
||||||
|
\li
|
||||||
|
\row
|
||||||
|
\li \uicontrol Path
|
||||||
|
\li Determines how to specify the path when setting breakpoints:
|
||||||
|
\list
|
||||||
|
\li \uicontrol {Use Engine Default} is the preferred setting of
|
||||||
|
the debugger engine.
|
||||||
|
\li \uicontrol {Use Full Path} passes the full path to avoid
|
||||||
|
ambiguity if several modules contain files with the same
|
||||||
|
name. This is the engine default for CDB and LLDB.
|
||||||
|
\li \uicontrol {Use File Name} passes the file name only. This is
|
||||||
|
useful when the location of the source tree does not match
|
||||||
|
the one used when building the modules. This is the engine
|
||||||
|
default for GDB as using full paths can be slow with it.
|
||||||
|
\endlist
|
||||||
|
\row
|
||||||
|
\li \uicontrol Module
|
||||||
|
\li Specify the module (base name of the library or executable) for
|
||||||
|
function or file type breakpoints to speed up debugger startup
|
||||||
|
(CDB, LLDB).
|
||||||
|
\row
|
||||||
|
\li \uicontrol Commands
|
||||||
|
\li Commands to execute when the application stops. List one command per
|
||||||
|
line. GDB executes the commands in the order in which you specify
|
||||||
|
them.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Tracepoint only}
|
||||||
|
\li A \e tracepoint lets you log information about the application
|
||||||
|
without adding log statements or otherwise modifying your code.
|
||||||
|
You can set conditions for the tracepoint.
|
||||||
|
\row
|
||||||
|
\li \uicontrol Message
|
||||||
|
\li The tracepoint message to show in \l {Application Output}.
|
||||||
|
\endtable
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
\section1 Specifying Breakpoint Settings
|
\section1 Specifying Breakpoint Settings
|
||||||
|
|
||||||
@@ -171,6 +222,8 @@
|
|||||||
\uicontrol Preferences > \uicontrol Debugger. For more information,
|
\uicontrol Preferences > \uicontrol Debugger. For more information,
|
||||||
see \l{Debugger Preferences}.
|
see \l{Debugger Preferences}.
|
||||||
|
|
||||||
|
\image qtcreator-debugger-general-options.png {General tab in Debugger preferences}
|
||||||
|
|
||||||
To use a full absolute path in breakpoints, select the
|
To use a full absolute path in breakpoints, select the
|
||||||
\uicontrol {Set breakpoints using a full absolute path} check box.
|
\uicontrol {Set breakpoints using a full absolute path} check box.
|
||||||
|
|
||||||
@@ -261,12 +314,12 @@
|
|||||||
disabled breakpoint. To re-enable a breakpoint, use any of the above
|
disabled breakpoint. To re-enable a breakpoint, use any of the above
|
||||||
methods.
|
methods.
|
||||||
|
|
||||||
With the notable exception of data breakpoints, breakpoints retain their
|
Other than data breakpoints retain their enabled or disabled state when the
|
||||||
enabled or disabled state when the debugged program is restarted.
|
debugged application is restarted.
|
||||||
|
|
||||||
\section1 Setting Data Breakpoints
|
\section1 Setting Data Breakpoints
|
||||||
|
|
||||||
A \e {data breakpoint} stops the program when data is read or written at the
|
A \e {data breakpoint} stops the application when data is read or written at the
|
||||||
specified address.
|
specified address.
|
||||||
|
|
||||||
To set a data breakpoint at an address:
|
To set a data breakpoint at an address:
|
||||||
@@ -291,8 +344,8 @@
|
|||||||
\uicontrol {Add Data Breakpoint at Object's Address} in the
|
\uicontrol {Add Data Breakpoint at Object's Address} in the
|
||||||
context menu to set the data breakpoint.
|
context menu to set the data breakpoint.
|
||||||
|
|
||||||
Data breakpoints will be disabled when the debugged program exits, as it
|
Data breakpoints will be disabled when the debugged application exits, as it
|
||||||
is unlikely that the used addresses will stay the same at the next program
|
is unlikely that the used addresses will stay the same at the next application
|
||||||
launch. If you really want a data breakpoint to be active again, re-enable
|
launch. If you really want a data breakpoint to be active again, re-enable
|
||||||
it manually.
|
it manually.
|
||||||
*/
|
*/
|
||||||
@@ -313,7 +366,7 @@
|
|||||||
|
|
||||||
\image qtcreator-locals.png {Locals view}
|
\image qtcreator-locals.png {Locals view}
|
||||||
|
|
||||||
Whenever a program stops under the control of the debugger, it retrieves
|
Whenever an application stops under the control of the debugger, it retrieves
|
||||||
information about the topmost stack frame and displays it in the
|
information about the topmost stack frame and displays it in the
|
||||||
\uicontrol {Locals} view. The \uicontrol Locals pane shows
|
\uicontrol {Locals} view. The \uicontrol Locals pane shows
|
||||||
information about parameters of the function in that frame as well as the
|
information about parameters of the function in that frame as well as the
|
||||||
@@ -321,6 +374,35 @@
|
|||||||
function after pressing \key {Shift+F11}, the \uicontrol {Return Value}
|
function after pressing \key {Shift+F11}, the \uicontrol {Return Value}
|
||||||
pane displays the value returned by the function.
|
pane displays the value returned by the function.
|
||||||
|
|
||||||
|
You can expand the view contents to check that your application sets a
|
||||||
|
local value correctly.
|
||||||
|
|
||||||
|
\if defined(qtcreator)
|
||||||
|
\section1 Locals View Actions
|
||||||
|
|
||||||
|
Right-click the \uicontrol Locals view to select the following actions:
|
||||||
|
|
||||||
|
//! [0]
|
||||||
|
\list
|
||||||
|
\li Add and remove expression evaluators
|
||||||
|
\li Change value display format
|
||||||
|
\li Expand and collapse view contents
|
||||||
|
\li Copy view contents or expression values to the clipboard
|
||||||
|
\li Open view contents in an editor
|
||||||
|
\li Open memory editor
|
||||||
|
\li Set data breakpoints
|
||||||
|
\li Use \l{Using Debugging Helpers}{debugging helpers}
|
||||||
|
\li Show tooltips in the \uicontrol Locals view when debugging
|
||||||
|
\li Dereference pointers automatically
|
||||||
|
\li Sort members of classes and structs alphabetically
|
||||||
|
\li Use dynamic object type for display
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}
|
||||||
|
\endlist
|
||||||
|
//! [0]
|
||||||
|
\endif
|
||||||
|
|
||||||
|
\section1 Selecting Object Type for Display
|
||||||
|
|
||||||
When using GDB, you can specify whether the dynamic or the static type of
|
When using GDB, you can specify whether the dynamic or the static type of
|
||||||
objects will be displayed. Select \uicontrol {Use dynamic object type for
|
objects will be displayed. Select \uicontrol {Use dynamic object type for
|
||||||
display} in the context menu. Keep in mind that choosing the dynamic type
|
display} in the context menu. Keep in mind that choosing the dynamic type
|
||||||
@@ -339,45 +421,88 @@
|
|||||||
\title Evaluating Expressions
|
\title Evaluating Expressions
|
||||||
|
|
||||||
To compute values of arithmetic expressions or function calls, use
|
To compute values of arithmetic expressions or function calls, use
|
||||||
expression evaluators in the \uicontrol Expressions view. To insert a new
|
expression evaluators in the \uicontrol Expressions view.
|
||||||
expression evaluator, either double-click on an empty part of the
|
|
||||||
\uicontrol {Expressions} or \uicontrol {Locals} view, or select
|
|
||||||
\uicontrol {Add New Expression Evaluator} from the context menu, or drag and
|
|
||||||
drop an expression from the code editor.
|
|
||||||
|
|
||||||
\image qtcreator-debugger-expressions.png {Expressions view}
|
You can examine static variables that the debuggers don't pick up as
|
||||||
|
\e {local variables}. For example, if you define
|
||||||
|
\c {static int staticVar = 42;} in a source file and then add \c staticVar
|
||||||
|
as an evaluated expression, you should see \e 42 in the view when the
|
||||||
|
debugger stops in the source file.
|
||||||
|
|
||||||
|
\image qtcreator-debugger-expressions.webp {Expressions view}
|
||||||
|
|
||||||
|
\section1 Adding Expression Evaluators
|
||||||
|
|
||||||
|
To add expression evaluators, drag an expression from the code editor
|
||||||
|
to the \uicontrol Expressions view.
|
||||||
|
|
||||||
|
You can also:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Double-click in the \uicontrol {Expressions} or
|
||||||
|
\l {Local Variables and Function Parameters}{Locals} view.
|
||||||
|
\li Select \uicontrol {Add New Expression Evaluator} from the context
|
||||||
|
menu.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
Enter the expression in the \uicontrol {New Evaluated Expression} dialog:
|
||||||
|
|
||||||
|
\image qtcreator-debugger-new-evaluated-expression.webp {New Evaluated Expression dialog}
|
||||||
|
|
||||||
|
\omit
|
||||||
|
## Visible in the context menu, but does not currently work.
|
||||||
|
|
||||||
|
To insert widgets into expression evaluators, select a
|
||||||
|
widget in the debugged application and then select
|
||||||
|
\uicontrol {Select Widget to Add into Expression Evaluator}
|
||||||
|
in the context menu.
|
||||||
|
\endomit
|
||||||
|
|
||||||
|
The set of evaluated expressions is saved in your session.
|
||||||
|
|
||||||
\note Expression evaluators are powerful, but slow down debugger operation
|
\note Expression evaluators are powerful, but slow down debugger operation
|
||||||
significantly. It is advisable to not use them excessively, and to remove
|
significantly. Use them sparingly and remove them when you no longer need
|
||||||
unneeded expression evaluators as soon as possible.
|
them.
|
||||||
|
|
||||||
Expression evaluators are re-evaluated whenever the current frame changes.
|
Expression evaluators are re-evaluated whenever the current frame changes.
|
||||||
Note that functions used in the expressions are called each time, even if
|
The functions used in the expressions are called each time, even if
|
||||||
they have side-effects.
|
they have side-effects.
|
||||||
|
|
||||||
|
\if defined(qtcreator)
|
||||||
|
\section1 Expressions View Actions
|
||||||
|
|
||||||
|
Right-click the \uicontrol Expressions view to select the following actions:
|
||||||
|
|
||||||
|
\include creator-debug-views.qdoc 0
|
||||||
|
\endif
|
||||||
|
|
||||||
|
\section1 JavaScript Expressions
|
||||||
|
|
||||||
The QML debugger can evaluate JavaScript expressions.
|
The QML debugger can evaluate JavaScript expressions.
|
||||||
|
|
||||||
\if defined(qtcreator)
|
\if defined(qtcreator)
|
||||||
|
|
||||||
|
\section1 C and C++ Expressions
|
||||||
|
|
||||||
GDB, LLDB and CDB support the evaluation of simple C and C++ expressions.
|
GDB, LLDB and CDB support the evaluation of simple C and C++ expressions.
|
||||||
Functions can be called only if they are actually compiled into the debugged
|
Functions can be called only if they are actually compiled into the debugged
|
||||||
executable or a library used by the executable. Most notably, inlined
|
executable or a library used by the executable. Inlined
|
||||||
functions such as most \c{operator[]} implementations of standard containers
|
functions such as most \c{operator[]} implementations of standard containers
|
||||||
are typically \e{not} available.
|
are typically \e{not} available.
|
||||||
|
|
||||||
When using GDB or LLDB as backend, a special ranged syntax can be used to
|
When using GDB or LLDB as backend, you can use a special ranged syntax to
|
||||||
display multiple values with one expression. A sub-expression of form
|
display multiple values with one expression. A sub-expression of form
|
||||||
\c{foo[a..b]} is split into a sequence of individually evaluated expressions
|
\c{foo[a..b]} is split into a sequence of individually evaluated expressions
|
||||||
\c{foo[a], ..., foo[b]}.
|
\c{foo[a], ..., foo[b]}.
|
||||||
|
|
||||||
Compound variables of struct or class type are displayed as expandable in
|
You can expand compound variables of struct or class type to show their
|
||||||
the view. Expand entries to show all members. Together with the display of
|
members. As you also see the variable value and type, you can examine and
|
||||||
value and type, you can examine and traverse the low-level layout of object
|
traverse the low-level layout of object data.
|
||||||
data.
|
|
||||||
|
|
||||||
GDB and LLDB, and therefore \QC's debugger, also work for optimized
|
GDB and LLDB, and therefore \QC's debugger, also work for optimized
|
||||||
builds on Linux and \macos. Optimization can lead to re-ordering
|
builds on Linux and \macos. Optimization can lead to re-ordering
|
||||||
of instructions or removal of some local variables, causing the
|
of instructions or removal of some local variables, causing the
|
||||||
\uicontrol {Locals} and \uicontrol {Expressions} view to show
|
\uicontrol {Locals} and \uicontrol {Expressions} views to show
|
||||||
unexpected data.
|
unexpected data.
|
||||||
|
|
||||||
The debug information from GCC does not include enough
|
The debug information from GCC does not include enough
|
||||||
@@ -388,8 +513,6 @@
|
|||||||
\uicontrol {not in scope}. Not all uninitialized objects,
|
\uicontrol {not in scope}. Not all uninitialized objects,
|
||||||
however, can be recognized as such.
|
however, can be recognized as such.
|
||||||
|
|
||||||
\note The set of evaluated expressions is saved in your session.
|
|
||||||
|
|
||||||
\section1 Inspecting Basic Qt Objects
|
\section1 Inspecting Basic Qt Objects
|
||||||
|
|
||||||
The most powerful feature of the debugger is that the \uicontrol {Locals}
|
The most powerful feature of the debugger is that the \uicontrol {Locals}
|
||||||
@@ -416,7 +539,7 @@
|
|||||||
|
|
||||||
You can use the \uicontrol {Locals} and \uicontrol {Expressions} view to change
|
You can use the \uicontrol {Locals} and \uicontrol {Expressions} view to change
|
||||||
the contents of variables of simple data types, for example, \c int, \c float,
|
the contents of variables of simple data types, for example, \c int, \c float,
|
||||||
\c QString and \c std::string when the program is interrupted. To do so,
|
\c QString and \c std::string when the application is interrupted. To do so,
|
||||||
click the \uicontrol Value column, modify the value with the inplace editor,
|
click the \uicontrol Value column, modify the value with the inplace editor,
|
||||||
and press \key Enter (or \key Return).
|
and press \key Enter (or \key Return).
|
||||||
|
|
||||||
|
|||||||
@@ -18,12 +18,12 @@
|
|||||||
\l{Specifying Breakpoint Settings}{specify settings for breakpoints},
|
\l{Specifying Breakpoint Settings}{specify settings for breakpoints},
|
||||||
and map source paths to target paths.
|
and map source paths to target paths.
|
||||||
|
|
||||||
You can view debug output in the \uicontrol {Debugger Log} view.
|
You can view debug output in the \l {Debugger Log} view.
|
||||||
However, in some Linux distributions, such as Arch Linux, debug
|
However, in some Linux distributions, such as Arch Linux, debug
|
||||||
output is sent to the system log. To override this behavior, select
|
output is sent to the system log. To override this behavior, select
|
||||||
the \uicontrol {Force logging to console} check box. This sets
|
the \uicontrol {Force logging to console} check box. This sets
|
||||||
\c QT_LOGGING_TO_CONSOLE=1 in the environment of the debugged
|
\c QT_LOGGING_TO_CONSOLE=1 in the environment of the debugged
|
||||||
program, which effectively prevents storing debug output in
|
application, which effectively prevents storing debug output in
|
||||||
system logs.
|
system logs.
|
||||||
|
|
||||||
\section1 Mapping Source Paths
|
\section1 Mapping Source Paths
|
||||||
@@ -96,7 +96,7 @@
|
|||||||
future, select the \uicontrol {Use automatic symbol cache} check box.
|
future, select the \uicontrol {Use automatic symbol cache} check box.
|
||||||
|
|
||||||
To execute GDB commands after GDB has been started, but before the debugged
|
To execute GDB commands after GDB has been started, but before the debugged
|
||||||
program is started or attached, and before the debugging helpers are
|
application is started or attached, and before the debugging helpers are
|
||||||
initialized, enter them in the \uicontrol {Additional Startup Commands}
|
initialized, enter them in the \uicontrol {Additional Startup Commands}
|
||||||
field.
|
field.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2021 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
@@ -15,48 +15,57 @@
|
|||||||
|
|
||||||
\title Setting Up Debugger
|
\title Setting Up Debugger
|
||||||
|
|
||||||
The main debugger settings are associated with the
|
The main debugger preferences are associated with the
|
||||||
\l{glossary-buildandrun-kit}{kit} you build and run your project with. To
|
\l{Adding Kits}{kit} you build and run your project with. To
|
||||||
specify the debugger and compiler to use for each kit, select
|
specify the debugger and compiler to use for each kit, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol Kits.
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol Kits.
|
||||||
|
|
||||||
|
\image qtcreator-kits.png {Kits preferences}
|
||||||
|
|
||||||
You need to set up the debugger only if the automatic setup fails because
|
You need to set up the debugger only if the automatic setup fails because
|
||||||
the native debugger is missing (as is usually the case for the CDB debugger
|
the native debugger is missing (for example, you must install the CDB
|
||||||
on Windows, which you always must install yourself) or because the installed
|
debugger on Windows yourself) or because \QC does not support the installed
|
||||||
version is not supported. For example, when your system does not have GDB
|
version. For example, when your system does not have GDB
|
||||||
installed or the installed version is outdated, and you want to use a locally
|
installed or the installed version is outdated, and you want to use a locally
|
||||||
installed replacement instead.
|
installed replacement instead.
|
||||||
|
|
||||||
\note If you need to change the debugger to use for an automatically
|
To change the debugger in an automatically detected kit, select
|
||||||
detected \l{glossary-buildandrun-kit}{kit}, you can \uicontrol Clone the
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol Kits >
|
||||||
kit and change the parameters in the clone. Make sure to select the cloned
|
\uicontrol Clone to create a copy of the kit, and change the
|
||||||
kit for your project.
|
parameters in the cloned kit. Make sure to enable the cloned kit
|
||||||
|
for your project.
|
||||||
|
|
||||||
If the debugger you want to use is not automatically detected, select
|
If the debugger you want to use is not automatically detected, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol Kits >
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol Kits >
|
||||||
\uicontrol Debuggers > \uicontrol Add to add it.
|
\uicontrol Debuggers > \uicontrol Add to add it.
|
||||||
|
|
||||||
\note To use the debugging tools for Windows, you must install them and add
|
\image qtcreator-preferences-kits-debuggers.webp {Debuggers tab in Kits preferences}
|
||||||
the Microsoft Symbol Server to the symbol search path of the
|
|
||||||
debugger. For more information, see \l{Setting CDB Paths on Windows}.
|
|
||||||
|
|
||||||
\note To use the Free Software Foundation (FSF) version of GDB on \macos, you
|
To use the debugging tools for Windows, you must install them.
|
||||||
must sign it and modify your \l{glossary-buildandrun-kit}{kit} settings.
|
Optionally, you can set up the Microsoft Symbol Server if you need
|
||||||
|
symbol information from Microsoft modules that is not found locally.
|
||||||
|
For more information, see \l{Setting CDB Paths on Windows}.
|
||||||
|
|
||||||
This section describes the options you have for debugging C++ code and
|
To use the Free Software Foundation (FSF) version of GDB on \macos, you
|
||||||
installing the supported native debuggers. It also
|
must sign it and modify your kit preferences.
|
||||||
applies for code in other compiled languages such as C, FORTRAN, Ada.
|
|
||||||
|
|
||||||
For more information on the debugger modes, see
|
This section describes the options you have for debugging C++ and Python code
|
||||||
\l{Launching the Debugger in Different Modes}.
|
and installing the supported native debuggers. It also
|
||||||
|
applies to code in other compiled languages such as C, FORTRAN, and Ada.
|
||||||
|
|
||||||
|
For more information about launching the debugger in different modes, see
|
||||||
|
\l{Debugger Operating Modes}.
|
||||||
|
|
||||||
\section1 Supported Native Debugger Versions
|
\section1 Supported Native Debugger Versions
|
||||||
|
|
||||||
\QC supports native debuggers when working with compiled code. On
|
\QC supports native debuggers for debugging compiled code.
|
||||||
most supported platforms, the GNU Symbolic Debugger GDB can be used. On
|
On most supported platforms, you can use the GNU Symbolic Debugger (GDB).
|
||||||
Microsoft Windows, when using the Microsoft tool chain, the Microsoft
|
On Microsoft Windows, when using the Microsoft tool chain, you need the
|
||||||
Console Debugger CDB is needed. On \macos and Linux, the LLDB debugger
|
Microsoft Console Debugger (CDB). On \macos and Linux, you can use the LLDB
|
||||||
can be used.
|
debugger. On all supported platforms, you can use PDB to debug Python source
|
||||||
|
code.
|
||||||
|
|
||||||
|
\note You need a debugger version built with Python scripting support.
|
||||||
|
|
||||||
The following table summarizes the support for debugging C++ code:
|
The following table summarizes the support for debugging C++ code:
|
||||||
|
|
||||||
@@ -89,28 +98,26 @@
|
|||||||
|
|
||||||
\section2 Supported GDB Versions
|
\section2 Supported GDB Versions
|
||||||
|
|
||||||
Starting with version 3.1, \QC requires the Python scripting extension. GDB
|
Use GDB 7.5, or later, with the Python scripting extension and Python version
|
||||||
builds without Python scripting are not supported anymore and will not work.
|
3.3, or later.
|
||||||
The minimum supported version is GDB 7.5 using Python version 2.7, or 3.3,
|
|
||||||
or newer.
|
|
||||||
|
|
||||||
For remote debugging using GDB and GDB server, the minimum supported version
|
For remote debugging using GDB and GDB server, the minimum supported version
|
||||||
of GDB server on the target \l{glossary-device}{device} is 7.0.
|
of GDB server on the target \l{glossary-device}{device} is 7.0.
|
||||||
|
|
||||||
\section2 Supported CDB Versions
|
\section2 Supported CDB Versions
|
||||||
|
|
||||||
All versions of CDB targeting platforms supported by Qt are supported by
|
\QC supports all versions of CDB targeting platforms that Qt supports.
|
||||||
\QC.
|
|
||||||
|
|
||||||
\section2 Supported LLDB Versions
|
\section2 Supported LLDB Versions
|
||||||
|
|
||||||
The LLDB native debugger has similar functionality to the GDB debugger. LLDB
|
The LLDB native debugger has similar functionality to the GDB debugger. LLDB
|
||||||
is the default debugger in Xcode on \macos for supporting C++ on the desktop.
|
is the default debugger in Xcode on \macos for C++ on the desktop.
|
||||||
LLDB is typically used with the Clang compiler (even though you can use it
|
LLDB is typically used with the Clang compiler (even though you can use it
|
||||||
with GCC, too).
|
with GCC, too).
|
||||||
|
|
||||||
On \macos you can use the LLDB version delivered with Xcode or build from source.
|
On \macos you can use the LLDB version delivered with Xcode or build from source.
|
||||||
The minimum supported version is LLDB 320.4.
|
The minimum supported version is LLDB 320.4. You need a LLDB version built
|
||||||
|
with Python support.
|
||||||
|
|
||||||
On Linux, the minimum supported version is LLDB 3.8.
|
On Linux, the minimum supported version is LLDB 3.8.
|
||||||
|
|
||||||
@@ -182,22 +189,15 @@
|
|||||||
the required files in
|
the required files in
|
||||||
\c{"%ProgramFiles%\Debugging Tools for Windows"}.
|
\c{"%ProgramFiles%\Debugging Tools for Windows"}.
|
||||||
|
|
||||||
\section3 Symbol Server
|
|
||||||
|
|
||||||
We highly recommend that you add the Microsoft Symbol Server to the
|
|
||||||
symbol search path of the debugger. The Symbol Server has debugging
|
|
||||||
information for the operating system libraries for debugging Windows
|
|
||||||
applications. For more information, see \l{Setting CDB Paths on Windows}.
|
|
||||||
|
|
||||||
\section2 Debugging Tools for \macos
|
\section2 Debugging Tools for \macos
|
||||||
|
|
||||||
The Qt binary distribution has both debug and release
|
The Qt binary distribution has both debug and release
|
||||||
variants of the libraries. But you have to explicitly tell the
|
variants of the libraries. However, you have to explicitly tell the
|
||||||
runtime linker that you want to use the debug libraries even if
|
runtime linker that you want to use the debug libraries even if
|
||||||
your application is compiled as debug, as release is the default
|
your application is compiled as debug, as release is the default
|
||||||
library.
|
library.
|
||||||
|
|
||||||
If you use a qmake based project in \QC, you can set a flag in
|
If you use a qmake based project in \QC, you can set a flag in
|
||||||
your \l{glossary-run-config}{run configuration}, in
|
your \l{glossary-run-config}{run configuration}, in
|
||||||
\uicontrol Projects mode. In the run configuration, select
|
\uicontrol Projects mode. In the run configuration, select
|
||||||
\uicontrol{Use debug version of frameworks}.
|
\uicontrol{Use debug version of frameworks}.
|
||||||
@@ -210,6 +210,27 @@
|
|||||||
|
|
||||||
We recommend using the LLDB version that is delivered with the latest Xcode.
|
We recommend using the LLDB version that is delivered with the latest Xcode.
|
||||||
|
|
||||||
|
\section2 PDB
|
||||||
|
|
||||||
|
\l{https://docs.python.org/3/library/pdb.html}{PDB} is a source code debugger
|
||||||
|
for Python applications. You can use it to debug projects that have a
|
||||||
|
\l {Creating Widget-Based Qt for Python Applications}{.pyproject}
|
||||||
|
configuration file.
|
||||||
|
|
||||||
|
You must install Python and set the interpreter to use in \uicontrol Projects
|
||||||
|
> \uicontrol Run:
|
||||||
|
|
||||||
|
\image qtcreator-run-settings-python.webp {Run settings for a Python project}
|
||||||
|
|
||||||
|
Start debugging the \c main.py file. If you encounter problems, check the
|
||||||
|
active build target in the kit selector.
|
||||||
|
|
||||||
|
\QC does not support mixed-mode debugging, but you can attach GDB to the
|
||||||
|
Python interpreter to debug the C++ implementation of the corresponding
|
||||||
|
Python code. For more information, see
|
||||||
|
\l{https://doc.qt.io/qtforpython-6/tutorials/debugging/qtcreator/qtcreator.html}
|
||||||
|
{Debugging PySide with Qt Creator (Linux)}.
|
||||||
|
|
||||||
\section1 Setting up FSF GDB for \macos
|
\section1 Setting up FSF GDB for \macos
|
||||||
|
|
||||||
To use FSF GDB on \macos, you must sign it and add it to the \QC
|
To use FSF GDB on \macos, you must sign it and add it to the \QC
|
||||||
@@ -264,7 +285,7 @@
|
|||||||
(\c $HOME/gdb72/bin/fsfgdb, but with an explicit value for
|
(\c $HOME/gdb72/bin/fsfgdb, but with an explicit value for
|
||||||
\c $HOME).
|
\c $HOME).
|
||||||
|
|
||||||
\li To use the debugger, add the kit in the \uicontrol {Build Settings}
|
\li To use the debugger, enable the kit in the \uicontrol {Build Settings}
|
||||||
of the project.
|
of the project.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
low level virtual machine (LLVM) project, LLDB.
|
low level virtual machine (LLVM) project, LLDB.
|
||||||
\li Debug QML and Java code and Qt Quick applications -
|
\li Debug QML and Java code and Qt Quick applications -
|
||||||
QML/JavaScript debugger.
|
QML/JavaScript debugger.
|
||||||
\li Debug Python source code - \c pdb.
|
\li Debug Python source code - PDB.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The following sections describe how to set up, launch, and interact with the
|
The following sections describe how to set up, launch, and interact with the
|
||||||
@@ -130,44 +130,47 @@
|
|||||||
debugger, select the \inlineimage icons/qtcreator-debug-button.png
|
debugger, select the \inlineimage icons/qtcreator-debug-button.png
|
||||||
(\uicontrol {Start Debugging of Startup Project}) button or press \key F5.
|
(\uicontrol {Start Debugging of Startup Project}) button or press \key F5.
|
||||||
|
|
||||||
\QC checks whether the compiled program is up-to-date, and rebuilds and
|
\QC checks whether the compiled application is up-to-date, and rebuilds and
|
||||||
deploys it if you set the \uicontrol {Build before deploying} field to
|
deploys it if you set the \uicontrol {Build before deploying} field to
|
||||||
build the whole project or the application to run and select he
|
build the whole project or the application to run and select he
|
||||||
\uicontrol {Always deploy before running} check box in
|
\uicontrol {Always deploy before running} check box in
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} >
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Build & Run} >
|
||||||
\uicontrol General. To debug the program without deploying
|
\uicontrol General. To debug the application without deploying
|
||||||
it, select \uicontrol Debug > \uicontrol {Start Debugging} >
|
it, select \uicontrol Debug > \uicontrol {Start Debugging} >
|
||||||
\uicontrol {Start Debugging Without Deployment}.
|
\uicontrol {Start Debugging Without Deployment}.
|
||||||
|
|
||||||
The debugger then takes over and starts the program with suitable
|
The debugger then takes over and starts the application with suitable
|
||||||
parameters.
|
parameters.
|
||||||
|
|
||||||
When using GDB or CDB as debug backend, you can specify additional commands
|
When using GDB or CDB as debug backend, you can specify additional commands
|
||||||
to execute before and after the backend and debugged program are started or
|
to execute before and after the backend and debugged application are started or
|
||||||
attached in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
attached in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
||||||
\uicontrol GDB and \uicontrol CDB. For more information, see
|
\uicontrol GDB and \uicontrol CDB. For more information, see
|
||||||
\l{Debugger Preferences}.
|
\l{Debugger Preferences}.
|
||||||
|
|
||||||
To allow reading the user's default .gdbinit file on debugger startup,
|
To let the debugger read the user's default .gdbinit file when it starts,
|
||||||
select the \uicontrol {Load .gdbinit file on startup} check box in
|
select the \uicontrol {Load .gdbinit file on startup} check box in
|
||||||
GDB settings. For more information, see \l{Specifying GDB Settings}.
|
GDB settings. For more information, see \l{Specifying GDB Settings}.
|
||||||
|
|
||||||
\note Starting a C++ program in the debugger can take a long time, typically
|
\note Starting a C++ application under the control of the debugger can take
|
||||||
in the range of several seconds to minutes if complex features are used.
|
a long time. Typically, in the range of several seconds to minutes if you use
|
||||||
|
complex features.
|
||||||
|
|
||||||
\section1 Launching the Debugger in Different Modes
|
For \l {Creating Widget-Based Qt for Python Applications}{Python} projects,
|
||||||
|
start debugging the \c main.py file. If you encounter problems, check the
|
||||||
|
active build target in the \l{Building for Multiple Platforms}{kit selector}.
|
||||||
|
|
||||||
|
\section1 Debugger Operating Modes
|
||||||
|
|
||||||
The debugger plugin can run the native debuggers in various operating modes
|
The debugger plugin can run the native debuggers in various operating modes
|
||||||
depending on where and how the debugged process is started and run. Some of
|
depending on where and how you start and run the debugged process. Some of
|
||||||
the modes are only available for a particular operating system or platform.
|
the modes are only available for a particular operating system or platform.
|
||||||
|
|
||||||
In general, \key F5 and the \uicontrol {Start Debugging of Startup Project}
|
In general, \key F5 and the \uicontrol {Start Debugging of Startup Project}
|
||||||
button are set up in a
|
button start the operating mode that fits the context. So, for a C++
|
||||||
way to start the operating mode that is commonly used in a given context. So
|
application that uses the \MinGW toolchain targeting desktop Windows, the GDB
|
||||||
if the current project is set up as a C++ application using the \MinGW
|
engine starts in \e {start internal} mode. For a QML application that uses C++
|
||||||
toolchain targeting desktop Windows, the GDB engine will be started in Start
|
plugins, a \e mixed QML/C++ engine starts, with the C++ parts being
|
||||||
Internal mode. If the current project is a QML application using C++
|
|
||||||
plugins, a "mixed" QML/C++ engine will be started, with the C++ parts being
|
|
||||||
handled by GDB and GDB server remote debugging.
|
handled by GDB and GDB server remote debugging.
|
||||||
|
|
||||||
Change the run configuration parameters (such as
|
Change the run configuration parameters (such as
|
||||||
@@ -179,24 +182,24 @@
|
|||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li \b{Start Internal} to debug applications developed inside \QC such as
|
\li \e{Start internal} to debug applications developed inside \QC, such as
|
||||||
a Qt based GUI application.
|
a Qt Widgets-based application.
|
||||||
|
|
||||||
\li \b{Start External} to start and debug processes without a proper \QC
|
\li \e{Start external} to start and debug processes without a proper \QC
|
||||||
project setup, either locally or on a remote machine.
|
project setup, either locally or on a remote machine.
|
||||||
|
|
||||||
\li \b{Attach} to debug processes already started and running outside
|
\li \e{Attach} to debug processes already started and running outside
|
||||||
\QC, either locally or on a remote machine.
|
\QC, either locally or on a remote machine.
|
||||||
|
|
||||||
\li \b{Core} to debug crashed processes on Unix.
|
\li \e{Core} to debug crashed processes on Unix.
|
||||||
|
|
||||||
\li \b{Post-mortem} to debug crashed processes on Windows.
|
\li \e{Post-mortem} to debug crashed processes on Windows.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 Launching in Start Internal Mode
|
\section2 Start Internal
|
||||||
|
|
||||||
Start Internal mode is the default start mode for most projects, including
|
Start internal mode is the default start mode for most projects, including
|
||||||
all projects using a desktop Qt version and plain C++ projects.
|
all projects using a desktop Qt version and plain C++ projects.
|
||||||
|
|
||||||
If you need a console window to operate your application, for example
|
If you need a console window to operate your application, for example
|
||||||
@@ -211,19 +214,19 @@
|
|||||||
override the console set in the Windows system environment variables.
|
override the console set in the Windows system environment variables.
|
||||||
Note that the native console does not prompt on application exit.
|
Note that the native console does not prompt on application exit.
|
||||||
|
|
||||||
To launch the debugger in Start Internal mode, click the
|
To launch the debugger in start internal mode, click the
|
||||||
\uicontrol {Start Debugging} button for the active project.
|
\uicontrol {Start Debugging} button for the active project.
|
||||||
|
|
||||||
You can specify breakpoints before or after launching the debugger.
|
You can specify breakpoints before or after launching the debugger.
|
||||||
For more information, see \l{Setting Breakpoints}.
|
For more information, see \l{Setting Breakpoints}.
|
||||||
|
|
||||||
\section2 Launching in Start External Mode
|
\section2 Start External
|
||||||
|
|
||||||
You can debug any executable already present on your local or on a remote
|
You can debug any executable on your local or on a remote
|
||||||
machine without using a project. You specify a build and run kit that
|
machine without using a project. You specify a build and run kit that
|
||||||
identifies the device to debug the application on.
|
identifies the device to debug the application on.
|
||||||
|
|
||||||
While this mode does not strictly require a project to be opened in \QC,
|
While this mode does not strictly require a project to be open in \QC,
|
||||||
opening it makes setting breakpoints and stepping through the code easier.
|
opening it makes setting breakpoints and stepping through the code easier.
|
||||||
|
|
||||||
To start and debug an external application:
|
To start and debug an external application:
|
||||||
@@ -261,7 +264,7 @@
|
|||||||
configuration to use.
|
configuration to use.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 Launching in Attach Mode
|
\section2 Attach
|
||||||
|
|
||||||
You can attach the debugger to applications that are already running or
|
You can attach the debugger to applications that are already running or
|
||||||
instruct the debugger to attach to an application when it starts.
|
instruct the debugger to attach to an application when it starts.
|
||||||
@@ -285,7 +288,7 @@
|
|||||||
|
|
||||||
To terminate the selected process, select \uicontrol {Kill Process}.
|
To terminate the selected process, select \uicontrol {Kill Process}.
|
||||||
|
|
||||||
While this mode does not strictly require a project to be opened in \QC,
|
While this mode does not strictly require a project to be open in \QC,
|
||||||
opening it makes setting breakpoints and stepping through the code easier.
|
opening it makes setting breakpoints and stepping through the code easier.
|
||||||
|
|
||||||
You can specify breakpoints before or after attaching the debugger to the
|
You can specify breakpoints before or after attaching the debugger to the
|
||||||
@@ -312,14 +315,14 @@
|
|||||||
process to start.
|
process to start.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section2 Launching in Core Mode
|
\section2 Core
|
||||||
|
|
||||||
The Core mode is used to inspect \e {core} files (crash dumps) that are
|
Use the core mode to inspect \e {core} files (crash dumps) that are
|
||||||
generated from crashed processes on Linux and Unix systems if the system is
|
generated from crashed processes on Linux and Unix systems if the system is
|
||||||
set up to allow this.
|
set up to allow this.
|
||||||
|
|
||||||
To enable the dumping of core files on a Unix system, enter the following
|
To enable the dumping of core files on a Unix system, enter the following
|
||||||
command in the shell from which the application will be launched:
|
command in the shell from which the application is launched:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
ulimit -c unlimited
|
ulimit -c unlimited
|
||||||
@@ -350,12 +353,12 @@
|
|||||||
the \c sysroot to use instead of the default \c sysroot.
|
the \c sysroot to use instead of the default \c sysroot.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
Also in this mode, using a properly configured project that has the
|
Even though using a properly configured project that has the sources of the
|
||||||
sources of the crashed program is not strictly necessary, but helpful.
|
crashed application is not strictly necessary, it is helpful.
|
||||||
|
|
||||||
\section2 Launching in Post-Mortem Mode
|
\section2 Post-Mortem
|
||||||
|
|
||||||
The post-mortem mode is available only on Windows, if you have installed the
|
The post-mortem mode is available only on Windows, if you installed the
|
||||||
debugging tools for Windows.
|
debugging tools for Windows.
|
||||||
|
|
||||||
The \QC installation program asks you whether you want to register \QC as a
|
The \QC installation program asks you whether you want to register \QC as a
|
||||||
@@ -365,7 +368,7 @@
|
|||||||
|
|
||||||
You can launch the debugger in the post-mortem mode if an application
|
You can launch the debugger in the post-mortem mode if an application
|
||||||
crashes on Windows. Click the \uicontrol {Debug in \QC} button in the error
|
crashes on Windows. Click the \uicontrol {Debug in \QC} button in the error
|
||||||
message that is displayed by the Windows operating system.
|
message from the Windows operating system.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -552,43 +555,35 @@
|
|||||||
\title Debug Mode Views
|
\title Debug Mode Views
|
||||||
|
|
||||||
In the \uicontrol Debug mode, you can inspect the state of your
|
In the \uicontrol Debug mode, you can inspect the state of your
|
||||||
application while debugging. You can interact with the debugger
|
application while debugging.
|
||||||
in many ways, including the following:
|
|
||||||
|
\image qtcreator-debugger-views.webp {Debug mode views while debugging}
|
||||||
|
|
||||||
|
You can interact with the debugger in many ways:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li Go through a program line-by-line or instruction-by-instruction.
|
\li Interrupt running applications.
|
||||||
|
|
||||||
\li Interrupt running programs.
|
|
||||||
|
|
||||||
\li Set breakpoints.
|
\li Set breakpoints.
|
||||||
|
|
||||||
|
\li Step through an application line-by-line or
|
||||||
|
instruction-by-instruction.
|
||||||
|
|
||||||
\li Examine the contents of the call stack.
|
\li Examine the contents of the call stack.
|
||||||
|
|
||||||
\li Examine and modify contents of local and global variables.
|
\li Examine and modify contents of local and global variables.
|
||||||
|
|
||||||
\li Examine and modify registers and memory contents of
|
\li Examine and modify registers and memory contents of
|
||||||
the debugged program.
|
the debugged application.
|
||||||
|
|
||||||
\li Examine the list of loaded shared libraries.
|
\li Examine the list of loaded shared libraries.
|
||||||
|
|
||||||
\li Disassemble sections of code.
|
\li Disassemble sections of code.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC displays the raw information from the native debuggers in a clear
|
The following table summarizes the \uicontrol Debug mode views with links to
|
||||||
and concise manner with the goal to simplify the debugging process as much
|
more information.
|
||||||
as possible without losing the power of the native debuggers.
|
|
||||||
|
|
||||||
In addition to the generic IDE functionality of the stack view, views
|
|
||||||
for locals and expressions, registers, and so on, \QC includes features to
|
|
||||||
make debugging Qt-based applications easy. The debugger plugin understands
|
|
||||||
the internal layout of several Qt classes, for example, QString, the Qt
|
|
||||||
containers, and most importantly QObject (and classes derived from it), as
|
|
||||||
well as most containers of the C++ Standard Library and some GCC extensions.
|
|
||||||
It uses this deeper understanding to present objects of such classes in a
|
|
||||||
useful way.
|
|
||||||
|
|
||||||
Interact with the program you are debugging in the following views.
|
|
||||||
|
|
||||||
\table
|
\table
|
||||||
\header
|
\header
|
||||||
@@ -597,12 +592,14 @@
|
|||||||
\li Learn More
|
\li Learn More
|
||||||
\row
|
\row
|
||||||
\li Stack
|
\li Stack
|
||||||
\li Examine the the nested function calls leading to the current position
|
\li Examine the nested function calls leading to the current position
|
||||||
as a call stack trace.
|
as a call stack trace.
|
||||||
\li \l {Viewing Call Stack Trace}
|
\li \l {Viewing Call Stack Trace}
|
||||||
\row
|
\row
|
||||||
\li Breakpoints
|
\li Breakpoint Preset
|
||||||
\li Set \e {breakpoints} with conditions make the application stop in
|
|
||||||
|
Breakpoints
|
||||||
|
\li Set \e {breakpoints} with conditions to make the application stop in
|
||||||
a controlled way. A \e {watchpoint} stops the application when the
|
a controlled way. A \e {watchpoint} stops the application when the
|
||||||
value of an expression changes.
|
value of an expression changes.
|
||||||
\li \l {Setting Breakpoints}
|
\li \l {Setting Breakpoints}
|
||||||
@@ -635,9 +632,11 @@
|
|||||||
\row
|
\row
|
||||||
\li Peripheral Registers
|
\li Peripheral Registers
|
||||||
\li View the current state of peripheral registers.
|
\li View the current state of peripheral registers.
|
||||||
\li
|
\li \l {Peripheral Registers}
|
||||||
\row
|
\row
|
||||||
\li Debugger Log
|
\li Global Debugger Log
|
||||||
|
|
||||||
|
Debugger Log
|
||||||
\li View debug output to find out why the debugger does not work.
|
\li View debug output to find out why the debugger does not work.
|
||||||
|
|
||||||
The log view acts as a console, so you can send the contents
|
The log view acts as a console, so you can send the contents
|
||||||
@@ -645,7 +644,7 @@
|
|||||||
native debugger.
|
native debugger.
|
||||||
\li \l{Troubleshooting Debugger}
|
\li \l{Troubleshooting Debugger}
|
||||||
|
|
||||||
\l {Directly Interacting with Native Debuggers}
|
\l {Debugger Log}
|
||||||
\row
|
\row
|
||||||
\li Disassembler
|
\li Disassembler
|
||||||
\li View disassembled code for the current function.
|
\li View disassembled code for the current function.
|
||||||
@@ -656,19 +655,22 @@
|
|||||||
\li \l {Working in Edit Mode}
|
\li \l {Working in Edit Mode}
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
\note The \uicontrol Views menu shows some views only while you are
|
||||||
|
debugging.
|
||||||
|
|
||||||
\section1 Managing Debug Views
|
\section1 Managing Debug Views
|
||||||
|
|
||||||
The availability of views depends on whether
|
When you are not debugging, the \uicontrol Debug mode shows the
|
||||||
you are debugging C++ or QML. Frequently used views are shown by
|
\uicontrol {Debugger Preset} perspective:
|
||||||
default and rarely used ones are hidden. To change the default settings,
|
|
||||||
select \uicontrol View > \uicontrol Views, and then select views to
|
|
||||||
display or hide. Alternatively, you can enable or disable views from the
|
|
||||||
context menu of the title bar of any visible debug mode view.
|
|
||||||
|
|
||||||
\image qtcreator-debugger-views.png {Debug mode views}
|
\image qtcreator-debugger-views-initial.webp {Initial Debug mode views}
|
||||||
|
|
||||||
You can drag and drop the views in \QC to new positions on the screen. The
|
During debugging, the mode shows the views that you usually need to
|
||||||
size and position of views are saved for future sessions. Select
|
debug C++ or QML applications. To show other views or to hide views,
|
||||||
|
select \uicontrol Views.
|
||||||
|
|
||||||
|
You can drag the views in \QC to new positions on the screen. \QC saves the
|
||||||
|
size and position of views as a perspective for future sessions. Select
|
||||||
\uicontrol View > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
\uicontrol View > \uicontrol Views > \uicontrol {Reset to Default Layout}
|
||||||
to reset the views to their original sizes and positions.
|
to reset the views to their original sizes and positions.
|
||||||
|
|
||||||
@@ -680,13 +682,18 @@
|
|||||||
|
|
||||||
\section1 Customizing Debug Views
|
\section1 Customizing Debug Views
|
||||||
|
|
||||||
You can change the appearance and behavior of the debug views by specifying
|
To change the appearance and behavior of the debug views, set preferences
|
||||||
settings in \uicontrol Preferences > \uicontrol Debugger. For example, you can:
|
in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
||||||
|
\uicontrol General.
|
||||||
|
|
||||||
|
\image qtcreator-debugger-general-options.png {General tab in Debugger preferences}
|
||||||
|
|
||||||
|
For example, you can:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li Use alternating row colors in debug views.
|
\li Use alternating row colors in debug views.
|
||||||
\li Adopt font size changes from the main editor.
|
\li Adopt font size changes from the main editor.
|
||||||
\li Have tooltips displayed in the main editor while you are debugging.
|
\li Show tooltips in the main editor while you are debugging.
|
||||||
\li Close temporary source and memory views and switch to the previously
|
\li Close temporary source and memory views and switch to the previously
|
||||||
used \QC mode when the debugger exits.
|
used \QC mode when the debugger exits.
|
||||||
\li Bring \QC to the foreground when the debugged application is
|
\li Bring \QC to the foreground when the debugged application is
|
||||||
@@ -703,17 +710,19 @@
|
|||||||
|
|
||||||
\title Stopping Applications
|
\title Stopping Applications
|
||||||
|
|
||||||
Once the program starts running under the control of the debugger, it
|
Once the application starts running under the control of the debugger, it
|
||||||
behaves and performs as usual. You can interrupt a running C++ program by
|
behaves and performs as usual.
|
||||||
selecting \uicontrol Debug > \uicontrol Interrupt. The program is
|
|
||||||
automatically interrupted when a breakpoint is hit.
|
|
||||||
|
|
||||||
Once the program stops, \QC:
|
To interrupt a running C++ application, select \uicontrol Debug >
|
||||||
|
\uicontrol Interrupt. The debugger automatically interrupts
|
||||||
|
the application when it hits a \l {Setting Breakpoints}{breakpoint}.
|
||||||
|
|
||||||
|
Once the application stops, \QC:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li Retrieves data representing the \l{Viewing Call Stack Trace}
|
\li Retrieves data representing the \l{Viewing Call Stack Trace}
|
||||||
{call stack} at the program's current position.
|
{call stack} at the application's current position.
|
||||||
|
|
||||||
\li Retrieves the contents of \l{Local Variables and Function Parameters}
|
\li Retrieves the contents of \l{Local Variables and Function Parameters}
|
||||||
{local variables}.
|
{local variables}.
|
||||||
@@ -725,6 +734,8 @@
|
|||||||
{Disassembler} views if you are debugging C++ based applications.
|
{Disassembler} views if you are debugging C++ based applications.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
You can \l{Examining Data}{Examine} and change variables, set or remove
|
||||||
|
breakpoints, and then continue running the application.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -753,7 +764,7 @@
|
|||||||
\li To leave the current function or subfunction, press \key {Shift+F11}
|
\li To leave the current function or subfunction, press \key {Shift+F11}
|
||||||
(\key {Command+Shift+T} on \macos).
|
(\key {Command+Shift+T} on \macos).
|
||||||
|
|
||||||
\li To continue running the program, press \key F5.
|
\li To continue running the application, press \key F5.
|
||||||
|
|
||||||
\li To run to the line that has the cursor, press \key {Ctrl+F10}
|
\li To run to the line that has the cursor, press \key {Ctrl+F10}
|
||||||
(\key {Shift+F8} on \macos).
|
(\key {Shift+F8} on \macos).
|
||||||
@@ -763,7 +774,7 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
You can continue executing the program until the current
|
You can continue executing the application until the current
|
||||||
function completes or jump to an arbitrary position in the current function.
|
function completes or jump to an arbitrary position in the current function.
|
||||||
|
|
||||||
\section1 Stepping Into Code
|
\section1 Stepping Into Code
|
||||||
@@ -849,15 +860,15 @@
|
|||||||
\omit
|
\omit
|
||||||
\section2 Creating Snapshots
|
\section2 Creating Snapshots
|
||||||
|
|
||||||
A snapshot has the complete state of the debugged program at a time,
|
A snapshot has the complete state of the debugged application at a time,
|
||||||
including the full memory contents.
|
including the full memory contents.
|
||||||
|
|
||||||
To create snapshots of a debugged program, select \uicontrol {Create Snapshot}
|
To create snapshots of a debugged application, select \uicontrol {Create Snapshot}
|
||||||
in the context menu in the \uicontrol {Debugger Perspectives} view.
|
in the context menu in the \uicontrol {Debugger Perspectives} view.
|
||||||
|
|
||||||
Double-click on entries in the \uicontrol {Debugger Perspectives} view to
|
Double-click on entries in the \uicontrol {Debugger Perspectives} view to
|
||||||
switch between snapshots. The debug mode views are updated to reflect the state
|
switch between snapshots. The debug mode views are updated to reflect the state
|
||||||
of the program at time of taking the snapshot.
|
of the application at time of taking the snapshot.
|
||||||
|
|
||||||
\note Creating snapshots involves creating core files of the debugged process,
|
\note Creating snapshots involves creating core files of the debugged process,
|
||||||
requiring significant amount of disk space. For details, see
|
requiring significant amount of disk space. For details, see
|
||||||
@@ -873,10 +884,24 @@
|
|||||||
|
|
||||||
\title Viewing Threads
|
\title Viewing Threads
|
||||||
|
|
||||||
If a multi-threaded program is interrupted, the \uicontrol Threads view or
|
An application can have more than one thread of execution that share one
|
||||||
the combobox named \uicontrol Threads in the debugger status bar can be used
|
address space, which means that they can examine and change the same
|
||||||
to switch from one thread to another. The \uicontrol Stack view adjusts
|
variables. However, each thread has its own registers, execution stack,
|
||||||
itself accordingly.
|
and possibly private memory.
|
||||||
|
|
||||||
|
When a multi-threaded application is interrupted, you can view the threads
|
||||||
|
currently active in the application and switch between them in the
|
||||||
|
\uicontrol Threads view (1):
|
||||||
|
|
||||||
|
\image qtcreator-debugger-threads.webp {Threads view}
|
||||||
|
|
||||||
|
You can also select a thread in the \uicontrol Threads field (2) on the
|
||||||
|
debugger toolbar.
|
||||||
|
|
||||||
|
This allows you to select the thread that is in the focus of the debugger.
|
||||||
|
|
||||||
|
The \l {Viewing Call Stack Trace}{Stack} view adjusts its contents
|
||||||
|
accordingly.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -887,38 +912,59 @@
|
|||||||
\title Viewing Modules
|
\title Viewing Modules
|
||||||
|
|
||||||
The \uicontrol Modules view displays information that the debugger plugin
|
The \uicontrol Modules view displays information that the debugger plugin
|
||||||
has about modules included in the application that is being debugged. A
|
has about modules included in the application that is being debugged.
|
||||||
module is a dynamic link library (\c {.dll}) in Windows, a shared object
|
|
||||||
(\c {.so}) in Linux, and a dynamic shared library (\c {.dylib}) in \macos.
|
A module is:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li A dynamic link library (\c {.dll}) in Windows
|
||||||
|
\li A shared object (\c {.so}) in Linux
|
||||||
|
\li A dynamic shared library (\c {.dylib}) in \macos
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\image qtcreator-debugger-modules.webp {Modules view}
|
||||||
|
|
||||||
In addition, the view displays symbols within the modules and indicates
|
In addition, the view displays symbols within the modules and indicates
|
||||||
where each module was loaded.
|
where each module was loaded. Right-click column headers to show and
|
||||||
|
hide columns in the view.
|
||||||
|
|
||||||
Right-click the view to open a context menu that has menu items for:
|
Right-click the view to select the following actions:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li Updating the module list
|
\li Update the module list
|
||||||
|
|
||||||
\li Loading symbols for modules
|
\li Show source files for a module
|
||||||
|
|
||||||
\li Examining modules
|
\li Show dependencies between modules (Windows only)
|
||||||
|
|
||||||
\li Editing module files
|
\li Load symbols for modules
|
||||||
|
|
||||||
\li Showing symbols in modules
|
\li Examine modules
|
||||||
|
|
||||||
\li Showing dependencies between modules (Windows only)
|
\li Edit module files
|
||||||
|
|
||||||
|
\li Show symbols in modules
|
||||||
|
|
||||||
|
\li Show sections in modules
|
||||||
|
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
By default, the \uicontrol Modules view is hidden.
|
By default, the \uicontrol Modules view is hidden. To show it, select it in
|
||||||
|
\uicontrol Views on the debugger toolbar.
|
||||||
|
|
||||||
|
\section1 Breaking on Loading Modules in CDB
|
||||||
|
|
||||||
When using CDB as debug backend, you can specify that the debugger should
|
When using CDB as debug backend, you can specify that the debugger should
|
||||||
break when application modules are loaded or unloaded. To enable breaking
|
break when application modules are loaded or unloaded. To enable breaking
|
||||||
for the specified modules, select \uicontrol Edit > \uicontrol Preferences >
|
for the specified modules, select \uicontrol Edit > \uicontrol Preferences >
|
||||||
\uicontrol Debugger > \uicontrol CDB. For more information, see
|
\uicontrol Debugger > \uicontrol CDB.
|
||||||
\l{Specifying CDB Settings}.
|
|
||||||
|
\image qtcreator-cdb-options.png {CDB tab in Debugger preferences}
|
||||||
|
|
||||||
|
For more information, see \l{Specifying CDB Settings}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -933,56 +979,170 @@
|
|||||||
the source file is actually part of the project, or whether it was compiled
|
the source file is actually part of the project, or whether it was compiled
|
||||||
elsewhere. The view shows the path to each file in the file system.
|
elsewhere. The view shows the path to each file in the file system.
|
||||||
|
|
||||||
Right-click the view to open a context menu that has menu items for
|
\image qtcreator-debugger-source-files.webp {Source Files view}
|
||||||
reloading data and opening files.
|
|
||||||
|
Right-click the view to select the following actions:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Reload data
|
||||||
|
\li Open the selected file
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
By default, the \uicontrol {Source Files} view is hidden. To show it, select
|
||||||
|
it in \uicontrol Views on the debugger toolbar.
|
||||||
|
|
||||||
|
\section1 External Sources
|
||||||
|
|
||||||
To enable the debugger to step into the code and display the source code
|
To enable the debugger to step into the code and display the source code
|
||||||
when using a copy of the source tree at a location different from the one
|
when using a copy of the source tree at a location different from the one
|
||||||
at which the libraries were built, you can map source paths to target
|
at which the libraries were built, you can map source paths to target
|
||||||
paths. For more information, see \l{Mapping Source Paths}.
|
paths in \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
||||||
|
\uicontrol General:
|
||||||
|
|
||||||
By default, the \uicontrol {Source Files} view is hidden.
|
\image qtcreator-debugger-general-options.png {General tab in Debugger preferences}
|
||||||
|
|
||||||
|
For more information, see \l{Mapping Source Paths}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page creator-registers-view.html
|
\page creator-registers-view.html
|
||||||
\previouspage creator-expressions-view.html
|
\previouspage creator-expressions-view.html
|
||||||
\nextpage creator-debugger-log-view.html
|
\nextpage creator-peripheral-registers-view.html
|
||||||
|
|
||||||
\title Viewing and Editing Register State
|
\title Viewing and Editing Register State
|
||||||
|
|
||||||
The \uicontrol Registers view displays the current state of the CPU registers.
|
\e {Machine code} consists of machine language instructions that make the CPU
|
||||||
Depending on the CPU type, there will be different registers available. The
|
perform tasks, such as load or store, on units of data in the CPU's registers
|
||||||
values of registers that recently have changed are highlighted in red and empty
|
or memory.
|
||||||
register values as well as leading zeroes are grayed out.
|
|
||||||
|
|
||||||
In addition it is possible to edit the content of registers while the program is
|
The \uicontrol Registers view displays the current state of general-purpose
|
||||||
stopped. This applies to both General-purpose and Special-purpose registers.
|
and special-purpose CPU registers. The available registers depend on the CPU
|
||||||
Registers can be edited in the standard condensed view or in their particular parts
|
type.
|
||||||
if the register is displayed expanded.
|
|
||||||
|
|
||||||
By default, the \uicontrol Registers view is hidden.
|
\image qtcreator-debugger-registers-view.webp {Registers view}
|
||||||
|
|
||||||
|
You can view register values when the application stops. Double-click
|
||||||
|
register values to edit them.
|
||||||
|
|
||||||
|
The values of registers that recently changed are highlighted in red. Empty
|
||||||
|
register values and leading zeroes are grayed out.
|
||||||
|
|
||||||
|
Right-click column headers to show and hide the \uicontrol Name and
|
||||||
|
\uicontrol Value columns in the view.
|
||||||
|
|
||||||
|
Right-click the view to select the following actions:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Reload register list.
|
||||||
|
\li Open \l {Examining Memory}{Memory Editor} at the selected value.
|
||||||
|
\li Open the \l {Viewing Disassembled Code}{Disassembler} view.
|
||||||
|
\li Display a value in hexadecimal, decimal, octal, or binary format.
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
By default, the \uicontrol Registers view is hidden. To show it, select it in
|
||||||
|
\uicontrol Views on the debugger toolbar.
|
||||||
|
|
||||||
|
\section1 Examining Memory
|
||||||
|
|
||||||
|
You can examine memory in many formats, independently of the application's
|
||||||
|
data types.
|
||||||
|
|
||||||
|
To open the memory editor, select a value \uicontrol Registers view,
|
||||||
|
and then select \uicontrol {Open Memory Editor at <value>} or
|
||||||
|
\uicontrol {Open Memory View at <value>} in the context menu:
|
||||||
|
|
||||||
|
\image qtcreator-debugger-memory-editor.webp {Memory Editor}
|
||||||
|
|
||||||
|
Hover the mouse pointer on a value to see details as a tooltip.
|
||||||
|
|
||||||
|
Right-click a value to:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Copy the selection in ASCII or hexadecimal format.
|
||||||
|
\li Set a data breakpoint on the selection.
|
||||||
|
\li Jump to the selected address in the current data view or a new one.
|
||||||
|
\endlist
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*!
|
||||||
|
\page creator-peripheral-registers-view.html
|
||||||
|
\previouspage creator-registers-view.html
|
||||||
|
\nextpage creator-debugger-log-view.html
|
||||||
|
|
||||||
|
\title Peripheral Registers
|
||||||
|
|
||||||
|
The \uicontrol {Peripheral Registers} view displays the current state of
|
||||||
|
peripheral devices, such as a mouse, keyboard, display, printer, or USB
|
||||||
|
drive. Applications write registers to send information to the device and
|
||||||
|
read them to get information from the device. To read registers in a
|
||||||
|
peripheral device, the application accesses its I/O addresses with a load
|
||||||
|
or store instruction that the CPU issues.
|
||||||
|
|
||||||
|
\image qtcreator-debugger-peripheral-registers-view.webp {Peripheral Registers view}
|
||||||
|
|
||||||
|
The \uicontrol Access column shows whether the register is read-and-write
|
||||||
|
(\uicontrol RW), read-only (\uicontrol RO), or write-only (\uicontrol WO).
|
||||||
|
\uicontrol N/A means that the access type is not available.
|
||||||
|
|
||||||
|
Right-click column headers to show and hide columns in the view.
|
||||||
|
|
||||||
|
Right-click the view to select the following actions:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li View register groups.
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
By default, the \uicontrol {Peripheral Registers} view is hidden. To show it,
|
||||||
|
select it in \uicontrol Views on the debugger toolbar.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\page creator-debugger-log-view.html
|
\page creator-debugger-log-view.html
|
||||||
\previouspage creator-registers-view.html
|
\previouspage creator-peripheral-registers-view.html
|
||||||
\nextpage creator-disassembler-view.html
|
\nextpage creator-disassembler-view.html
|
||||||
|
|
||||||
\title Directly Interacting with Native Debuggers
|
\title Debugger Log
|
||||||
|
|
||||||
In some cases, it is convenient to directly interact with the command line
|
You can view debug output in the \uicontrol {Debugger Log} view to
|
||||||
of the native debugger. In \QC, you can use the left pane of the
|
\l {Debugger Does Not Work}{troubleshoot the debugger}.
|
||||||
\uicontrol {Debugger Log} view for that purpose. When you press
|
|
||||||
\key {Ctrl+Enter}, the contents of the line under the text cursor are sent
|
\image qtcreator-debugger-log-view.webp {Debugger Log view}
|
||||||
directly to the native debugger. Alternatively, you can use the line edit at
|
|
||||||
the bottom of the view. Output is displayed in the right pane of the
|
If debug output is sent to the system log, select \uicontrol Edit >
|
||||||
\uicontrol {Debugger Log} view.
|
\uicontrol Preferences > \uicontrol Debugger > \uicontrol General >
|
||||||
|
\uicontrol {Force logging to console} check box.
|
||||||
|
|
||||||
|
Right-click the view to select the following actions:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Copy, paste, cut, and delete log contents.
|
||||||
|
\li Undo and redo editing actions.
|
||||||
|
\li Select all log contents.
|
||||||
|
\li Clear log contents.
|
||||||
|
\li Save log contents as a file.
|
||||||
|
\li Log time stamps.
|
||||||
|
\li Reload debugging helpers after \l{Adding Custom Debugging Helpers}
|
||||||
|
{adding custom debugging helpers}.
|
||||||
|
\li Set \l{Debugger Preferences}{debugger preferences}.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Directly Interacting with Native Debuggers
|
||||||
|
|
||||||
|
You can use the left pane of the \uicontrol {Debugger Log} view to directly
|
||||||
|
interact with the command line of the native debugger.
|
||||||
|
|
||||||
|
Press \key {Ctrl+Enter} to send the contents of the line under the
|
||||||
|
text cursor to the native debugger. Or, enter the command in the
|
||||||
|
\uicontrol Command field. The right side pane of the
|
||||||
|
\uicontrol {Debugger Log} view shows the command output.
|
||||||
|
|
||||||
\note Usually, you do not need this feature because \QC offers better ways to
|
\note Usually, you do not need this feature because \QC offers better ways to
|
||||||
handle the task. For example, instead of using the GDB
|
handle the task. For example, instead of using the GDB
|
||||||
\c print command from the command line, you can evaluate an expression in
|
\c print command from the command line, you can evaluate an expression in
|
||||||
the \uicontrol {Expressions} view.
|
the \l {Evaluating Expressions}{Expressions} view.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -992,22 +1152,38 @@
|
|||||||
|
|
||||||
\title Viewing Disassembled Code
|
\title Viewing Disassembled Code
|
||||||
|
|
||||||
|
A \e disassembler translates machine language into assembly language for
|
||||||
|
human-readability.
|
||||||
|
|
||||||
The \uicontrol Disassembler view displays disassembled code for the current
|
The \uicontrol Disassembler view displays disassembled code for the current
|
||||||
function.
|
function. It is useful for low-level commands for checking single
|
||||||
|
instructions, such as \uicontrol {Step Into} and \uicontrol {Step Over}.
|
||||||
|
|
||||||
The \uicontrol Disassembler view is useful for low-level commands for checking
|
\image qtcreator-debugger-disassembler-view.webp {Disassembler view}
|
||||||
single instructions, such as \uicontrol {Step Into} and \uicontrol {Step Over}.
|
|
||||||
By default, the \uicontrol Disassembler view is hidden.
|
|
||||||
|
|
||||||
To access the \uicontrol Disassembler view, check
|
|
||||||
\uicontrol Debug > \uicontrol {Operate by Instruction} while the debugger is
|
|
||||||
running. Alternatively, click the
|
|
||||||
\inlineimage icons/debugger_singleinstructionmode.png
|
|
||||||
(\uicontrol {Operate by Instruction}) tool button on the debugger tool bar.
|
|
||||||
|
|
||||||
By default, GDB shows AT&T style disassembly. To switch to the Intel style,
|
By default, GDB shows AT&T style disassembly. To switch to the Intel style,
|
||||||
select \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
select \uicontrol Edit > \uicontrol Preferences > \uicontrol Debugger >
|
||||||
\uicontrol GDB > \uicontrol {Use Intel style disassembly}.
|
\uicontrol GDB > \uicontrol {Use Intel style disassembly}.
|
||||||
|
|
||||||
|
To open the \uicontrol Disassembler view:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Select \uicontrol Debug > \uicontrol {Operate by Instruction} while
|
||||||
|
the debugger is running.
|
||||||
|
\li Select the \inlineimage icons/debugger_singleinstructionmode.png
|
||||||
|
(\uicontrol {Operate by Instruction}) tool button on the debugger
|
||||||
|
toolbar.
|
||||||
|
\li In the \l {Viewing and Editing Register State}{Registers} view,
|
||||||
|
select a value, and then select \uicontrol {Open Disassembler at <value>}
|
||||||
|
in the context menu.
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\section1 Starting Disassembler
|
||||||
|
|
||||||
|
To start a disassembler from the \uicontrol Registers view, select
|
||||||
|
\uicontrol {Open Disassembler} and set the disassembler address:
|
||||||
|
|
||||||
|
\image qcreator-debugger-select-start-address.webp {Select Start Address dialog}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -1154,7 +1330,7 @@
|
|||||||
The custom debugging helpers will be automatically picked up from
|
The custom debugging helpers will be automatically picked up from
|
||||||
\c personaltypes.py when you start a debugging session in \QC or select
|
\c personaltypes.py when you start a debugging session in \QC or select
|
||||||
\uicontrol {Reload Debugging Helpers} from the context menu of the
|
\uicontrol {Reload Debugging Helpers} from the context menu of the
|
||||||
\uicontrol {Debugger Log} view.
|
\l {Debugger Log} view.
|
||||||
|
|
||||||
\section2 Debugging Helper Overview
|
\section2 Debugging Helper Overview
|
||||||
|
|
||||||
@@ -1700,7 +1876,7 @@
|
|||||||
|
|
||||||
\li In the \uicontrol Debug mode, select \uicontrol View >
|
\li In the \uicontrol Debug mode, select \uicontrol View >
|
||||||
\uicontrol Views > \uicontrol {Debugger Log} to open the
|
\uicontrol Views > \uicontrol {Debugger Log} to open the
|
||||||
\uicontrol {Debugger Log} view. Browse the contents of the pane on
|
\l {Debugger Log} view. Browse the contents of the pane on
|
||||||
the right hand side to find out what went wrong. Always attach the
|
the right hand side to find out what went wrong. Always attach the
|
||||||
contents of the pane to debugger-related questions to the \QC
|
contents of the pane to debugger-related questions to the \QC
|
||||||
mailing list (qt-creator@qt-project.org) or paste them to a
|
mailing list (qt-creator@qt-project.org) or paste them to a
|
||||||
@@ -1758,7 +1934,7 @@
|
|||||||
|
|
||||||
\section2 Disabling Incremental Linking
|
\section2 Disabling Incremental Linking
|
||||||
|
|
||||||
Incremental linking can affect debugging. If the debugger log has
|
Incremental linking can affect debugging. If the \l {Debugger Log} view shows
|
||||||
the \e {Unable to verify checksum of module} message, disable incremental
|
the \e {Unable to verify checksum of module} message, disable incremental
|
||||||
linking.
|
linking.
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -25,11 +25,9 @@
|
|||||||
{debuggers} and \l{Adding Qt Versions}{Qt versions}, in the Docker container
|
{debuggers} and \l{Adding Qt Versions}{Qt versions}, in the Docker container
|
||||||
and creates kits for the devices.
|
and creates kits for the devices.
|
||||||
|
|
||||||
You can use images that are available locally. You can pull
|
To pull images from Docker hub or other registries, use the
|
||||||
images from Docker hub or other registries using the
|
|
||||||
\l{https://docs.docker.com/engine/reference/commandline/pull/}{docker pull}
|
\l{https://docs.docker.com/engine/reference/commandline/pull/}{docker pull}
|
||||||
command. To check that an image is available locally, run the
|
command.
|
||||||
\c {docker images} command in a terminal.
|
|
||||||
|
|
||||||
\section1 Enabling Docker Plugin
|
\section1 Enabling Docker Plugin
|
||||||
|
|
||||||
@@ -54,22 +52,46 @@
|
|||||||
\uicontrol {Docker Device} > \uicontrol {Start Wizard}
|
\uicontrol {Docker Device} > \uicontrol {Start Wizard}
|
||||||
to search for images in your local Docker installation.
|
to search for images in your local Docker installation.
|
||||||
\li Select the Docker image to use, and then select \uicontrol OK.
|
\li Select the Docker image to use, and then select \uicontrol OK.
|
||||||
\li In \uicontrol Devices, check and modify Docker device preferences.
|
\li In \uicontrol Devices, check and change Docker device preferences.
|
||||||
\image qtcreator-preferences-devices-docker-device.webp "Docker device preferences"
|
\image qtcreator-preferences-devices-docker-device.png "Docker device preferences"
|
||||||
\li Select \uicontrol {Run as outside user} to use the user ID
|
|
||||||
and group ID of the user running \QC in the Docker container.
|
|
||||||
\li Select \uicontrol {Do not modify entry point} to stop \QC from
|
|
||||||
modifying the entry point of the image if the image starts into
|
|
||||||
a shell.
|
|
||||||
\li In \uicontrol {Paths to mount}, specify host directories to
|
|
||||||
mount into the container, such as the project directory.
|
|
||||||
\li In \uicontrol {Search locations}, select where to search
|
|
||||||
for kit items.
|
|
||||||
\li Select \uicontrol {Auto-detect Kit Items} to find kit items and to
|
|
||||||
create kits for the Docker device.
|
|
||||||
\li Select \uicontrol Apply to save your changes.
|
\li Select \uicontrol Apply to save your changes.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
The following table summarizes the options you can set.
|
||||||
|
|
||||||
|
\table
|
||||||
|
\header
|
||||||
|
\li Option
|
||||||
|
\li Value
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Run as outside user}
|
||||||
|
\li On Linux and \macos, sets the user ID and group ID of the user
|
||||||
|
running \QC in the Docker container. This option is not available
|
||||||
|
on Windows.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Do not modify entry point}
|
||||||
|
\li Stops \QC from modifying the \l {Modifying Entry Points}{entry point}
|
||||||
|
of the image. Make sure that the entry point starts a shell.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Enable flags needed for LLDB}
|
||||||
|
\li Adds the following flags to the container to allow LLDB to run:
|
||||||
|
\badcode
|
||||||
|
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined
|
||||||
|
\endcode
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Clangd executable}
|
||||||
|
\li The path to a remote Clangd executable to use for a remote code
|
||||||
|
model.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Paths to mount}
|
||||||
|
\li Host directories to \l{Specifying Paths to Mount}{mount} into the
|
||||||
|
container, such as the project directory.
|
||||||
|
\row
|
||||||
|
\li \uicontrol {Search locations}
|
||||||
|
\li Where to \l{Auto-detecting Kit Items}{automatically detect} kit
|
||||||
|
items.
|
||||||
|
\endtable
|
||||||
|
|
||||||
The following sections describe the Docker device preferences in more detail.
|
The following sections describe the Docker device preferences in more detail.
|
||||||
|
|
||||||
\section2 Selecting Docker Images
|
\section2 Selecting Docker Images
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
\QC supports both \e {code based tests} and \e {build system based tests}.
|
\QC supports both \e {code based tests} and \e {build system based tests}.
|
||||||
Code based testing offers special handling for particular testing
|
Code based testing offers special handling for particular testing
|
||||||
frameworks that is strongly tied to the underlying code models or
|
frameworks that strongly ties to the underlying code models or
|
||||||
specialized parsers. Build system based testing is independent from any
|
specialized parsers. Build system based testing is independent from any
|
||||||
testing frameworks. It retrieves information directly from the underlying
|
testing frameworks. It retrieves information directly from the underlying
|
||||||
build system and uses it or even the build system as such to execute the
|
build system and uses it or even the build system as such to execute the
|
||||||
@@ -20,14 +20,14 @@
|
|||||||
applications and libraries:
|
applications and libraries:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \l{https://www.boost.org/doc/libs/1_70_0/libs/test/doc/html/index.html}
|
\li \l{https://www.boost.org/doc/libs/1_81_0/libs/test/doc/html/index.html}
|
||||||
{Boost.Test}
|
{Boost.Test}
|
||||||
\li \l{https://github.com/catchorg/Catch2}{Catch2 test framework}
|
\li \l{https://github.com/catchorg/Catch2}{Catch2 test framework}
|
||||||
\li \l{https://github.com/google/googletest}{Google C++ Testing Framework}
|
\li \l{https://github.com/google/googletest}{Google C++ Testing Framework}
|
||||||
\li \l{Qt Test} framework
|
\li \l{Qt Test} framework
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC offers additional build system based support for
|
In addition, \QC offers build system based support for
|
||||||
\l{https://cmake.org/cmake/help/latest/manual/ctest.1.html}{CTest}.
|
\l{https://cmake.org/cmake/help/latest/manual/ctest.1.html}{CTest}.
|
||||||
|
|
||||||
You can use \QC to create, build, and run code based tests for your
|
You can use \QC to create, build, and run code based tests for your
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
\section1 Build System Based Tests
|
\section1 Build System Based Tests
|
||||||
|
|
||||||
The handling of build system based tests is disabled by default to avoid
|
By default, \QC does not handle build system based tests to avoid
|
||||||
interference with code based parsers. To enable build system based tests,
|
interference with code based parsers. To enable build system based tests,
|
||||||
select the respective test tool in \uicontrol Preferences > \uicontrol Testing
|
select the respective test tool in \uicontrol Preferences > \uicontrol Testing
|
||||||
> \uicontrol General.
|
> \uicontrol General.
|
||||||
@@ -47,12 +47,12 @@
|
|||||||
The information in the tests tree is usually more detailed
|
The information in the tests tree is usually more detailed
|
||||||
when using code based tests.
|
when using code based tests.
|
||||||
|
|
||||||
If you have enabled code based and build system based tests together you
|
If you enable both code based and build system based tests, you
|
||||||
may duplicate tests inside the tests tree. See also \l {Selecting Tests to Run}.
|
may duplicate tests inside the tests tree. See also \l {Selecting Tests to Run}.
|
||||||
|
|
||||||
\section1 Creating Tests
|
\section1 Creating Tests
|
||||||
|
|
||||||
You can use a wizard to create projects that have tests.
|
Use a wizard to create projects that have tests.
|
||||||
|
|
||||||
\section2 Creating Qt and Qt Quick Tests
|
\section2 Creating Qt and Qt Quick Tests
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
\li For a Qt test, select the \uicontrol {GUI Application} check
|
\li For a Qt test, select the \uicontrol {GUI Application} check
|
||||||
box to create a Qt application.
|
box to create a Qt application.
|
||||||
|
|
||||||
\image qtcreator-autotests-project-qt-test.png "Autotest project wizard - Qt Test"
|
\image qtcreator-autotests-project-qt-test.png {Autotest project wizard - Qt Test}
|
||||||
|
|
||||||
\li In the \uicontrol {Test case name} field, enter a name for
|
\li In the \uicontrol {Test case name} field, enter a name for
|
||||||
the test case.
|
the test case.
|
||||||
@@ -86,15 +86,15 @@
|
|||||||
|
|
||||||
\li For a Qt Quick test, select the
|
\li For a Qt Quick test, select the
|
||||||
\uicontrol {Generate setup code} check box to execute C++
|
\uicontrol {Generate setup code} check box to execute C++
|
||||||
code before any of the QML tests are run. The testing
|
code before running any of the QML tests. The testing
|
||||||
framework will call slots and invocable functions, as
|
framework will call slots and invocable functions, as
|
||||||
described in \l{Executing C++ Before QML Tests}.
|
described in \l{Executing C++ Before QML Tests}.
|
||||||
|
|
||||||
\image qtcreator-autotests-project-qtquick-test.png "Autotest project wizard - Qt Quick Test"
|
\image qtcreator-autotests-project-qtquick-test.png {Autotest project wizard - Qt Quick Test}
|
||||||
|
|
||||||
\li Select the \uicontrol {Generate initialization and cleanup
|
\li Select the \uicontrol {Generate initialization and cleanup
|
||||||
code} checkbox to add functions to your test that are
|
code} checkbox to add functions to your test that the
|
||||||
executed by the testing framework to initialize and clean
|
testing framework executes to initialize and clean
|
||||||
up the test.
|
up the test.
|
||||||
|
|
||||||
\li In the \uicontrol {Build system} field, select the build
|
\li In the \uicontrol {Build system} field, select the build
|
||||||
@@ -159,10 +159,10 @@
|
|||||||
\section2 Creating Boost Tests
|
\section2 Creating Boost Tests
|
||||||
|
|
||||||
To build and run Boost tests, you must have the Boost.Test installed on the
|
To build and run Boost tests, you must have the Boost.Test installed on the
|
||||||
development host. Typically, it is installed when you install Boost. You can
|
development host. Typically, the Boost installation includes it. You can
|
||||||
download Boost from \l{https://www.boost.org/}{Boost.org}.
|
download Boost from \l{https://www.boost.org/}{Boost.org}.
|
||||||
|
|
||||||
If Boost libraries can be found by the used compiler and build system, you
|
If the compiler and build system can find the Boost libraries, you
|
||||||
do not need to specify the include directory when creating the test.
|
do not need to specify the include directory when creating the test.
|
||||||
|
|
||||||
To create a Boost test:
|
To create a Boost test:
|
||||||
@@ -183,28 +183,27 @@
|
|||||||
the test case.
|
the test case.
|
||||||
\li In the \uicontrol {Boost include dir (optional)} field,
|
\li In the \uicontrol {Boost include dir (optional)} field,
|
||||||
enter the path to the directory that has files needed
|
enter the path to the directory that has files needed
|
||||||
by Boost.Test, such as \e version.hpp and a subfolder called
|
by Boost.Test, such as \e version.hpp and the \e test
|
||||||
\e test that has the test header files.
|
subfolder that contains the test header files.
|
||||||
\li In the \uicontrol {Build system} field, select the build
|
\li In the \uicontrol {Build system} field, select the build
|
||||||
system to use for building the project: qmake, CMake, or
|
system to use for building the project: qmake, CMake, or
|
||||||
Qbs.
|
Qbs.
|
||||||
\endlist
|
\endlist
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC creates the test in the specified project directory.
|
\QC creates the test in the project directory.
|
||||||
For more information about creating Boost tests, see
|
For more information about creating Boost tests, see
|
||||||
\l{https://www.boost.org/doc/libs/1_70_0/libs/test/doc/html/index.html}
|
\l{https://www.boost.org/doc/libs/1_81_0/libs/test/doc/html/index.html}
|
||||||
{Boost.Test}.
|
{Boost.Test}.
|
||||||
|
|
||||||
\section2 Creating Catch2 Tests
|
\section2 Creating Catch2 Tests
|
||||||
|
|
||||||
To build and run Catch2 tests, you either must have Catch2 libraries and
|
To build and run Catch2 tests, you can either install Catch2
|
||||||
headers installed, or you can use the single include header file in the
|
libraries and headers or use the single include header file in the
|
||||||
Catch2 repository.
|
Catch2 repository.
|
||||||
|
|
||||||
If the Catch2 headers can be found by the used compiler and build system
|
If the compiler and build system can find the Catch2 headers automatically,
|
||||||
automatically, you do not need to specify the include directory when
|
you do not need to specify the include directory when creating the test.
|
||||||
creating the test.
|
|
||||||
|
|
||||||
To create a basic Catch2 test:
|
To create a basic Catch2 test:
|
||||||
|
|
||||||
@@ -219,9 +218,9 @@
|
|||||||
\li In the \uicontrol {Test framework} field, select
|
\li In the \uicontrol {Test framework} field, select
|
||||||
\uicontrol {Catch2}.
|
\uicontrol {Catch2}.
|
||||||
\li In the \uicontrol {Test case name} field, specify a name
|
\li In the \uicontrol {Test case name} field, specify a name
|
||||||
to be used for the test case file.
|
for the test case file.
|
||||||
\li Select the \uicontrol {Use Qt libraries} check box
|
\li Select the \uicontrol {Use Qt libraries} check box
|
||||||
to use a self defined main function and set up the project
|
to use a self-defined main function and set up the project
|
||||||
to use Qt features.
|
to use Qt features.
|
||||||
\li In the \uicontrol {Catch2 include directory (optional)} field,
|
\li In the \uicontrol {Catch2 include directory (optional)} field,
|
||||||
you may enter a path to the directory that has the
|
you may enter a path to the directory that has the
|
||||||
@@ -232,36 +231,34 @@
|
|||||||
\endlist
|
\endlist
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC creates the test in the specified project directory.
|
\QC creates the test in the project directory.
|
||||||
For more information about creating Catch2 tests, see
|
For more information about creating Catch2 tests, see
|
||||||
\l{https://github.com/catchorg/Catch2/blob/master/docs/Readme.md}
|
\l{https://github.com/catchorg/Catch2/blob/master/docs/Readme.md}
|
||||||
{Catch2}.
|
{Catch2}.
|
||||||
|
|
||||||
\section2 Creating CTest Based Tests
|
\section2 Creating CTest Based Tests
|
||||||
|
|
||||||
CTest can execute tests for CMake based projects
|
CTest can execute tests for CMake based projects regardless of the test
|
||||||
and is not limited to a special test framework.
|
framework. You configure tests in the project file, usually, CMakeLists.txt.
|
||||||
You simply configure tests inside the project files, usually CMakeLists.txt.
|
Basically, you enable testing for the project and register the test
|
||||||
Basically this is done by enabling testing for the project and registering
|
applications or even special commands.
|
||||||
the test applications or even special commands.
|
|
||||||
|
|
||||||
\code
|
\code
|
||||||
enable_testing()
|
enable_testing()
|
||||||
add_test(NAME test_example COMMAND test_example)
|
add_test(NAME test_example COMMAND test_example)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\c test_example must of course be added as an executable before trying to
|
Add \c test_example as an executable before trying to register it as test.
|
||||||
register it as test or it may be any command that can be executed including
|
It may be any executable command including arguments.
|
||||||
arguments.
|
|
||||||
For detailed information on how to use CTest see
|
For detailed information on how to use CTest see
|
||||||
\l{https://gitlab.kitware.com/cmake/community/-/wikis/doc/ctest/Testing-With-CTest}
|
\l{https://gitlab.kitware.com/cmake/community/-/wikis/doc/ctest/Testing-With-CTest}
|
||||||
{Testing with CTest}.
|
{Testing with CTest}.
|
||||||
|
|
||||||
\section1 Setting Up the Google C++ Testing Framework
|
\section1 Setting Up the Google C++ Testing Framework
|
||||||
|
|
||||||
To build and run Google tests, you must have the Google C++ Testing
|
To build and run Google tests, install and configure the Google C++ Testing
|
||||||
framework installed and configured on the development host. You can either
|
framework on the development host. You can either clone it from Git Hub or
|
||||||
clone it from Git Hub or install it from an installation package.
|
install it from an installation package.
|
||||||
|
|
||||||
To configure a project to use a cloned Google testing framework, edit the
|
To configure a project to use a cloned Google testing framework, edit the
|
||||||
\c INCLUDEPATH variable in the project file (.pro) to include the source
|
\c INCLUDEPATH variable in the project file (.pro) to include the source
|
||||||
@@ -275,8 +272,7 @@
|
|||||||
\li \c googlemock/include
|
\li \c googlemock/include
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
You also need to add the necessary files to the \c SOURCES variable. For
|
Also, add the necessary files to the \c SOURCES variable. For example:
|
||||||
example:
|
|
||||||
|
|
||||||
\list
|
\list
|
||||||
\li \c googletest/src/gtest-all.cc
|
\li \c googletest/src/gtest-all.cc
|
||||||
@@ -320,7 +316,7 @@
|
|||||||
\li \inlineimage icons/qtcreator-run-failed-tests.png
|
\li \inlineimage icons/qtcreator-run-failed-tests.png
|
||||||
(\uicontrol {Run Failed Tests}) to re-run the tests which failed
|
(\uicontrol {Run Failed Tests}) to re-run the tests which failed
|
||||||
in the last run.
|
in the last run.
|
||||||
Depending on the framework this may select additional tests if it
|
Depending on the framework, this may select more tests if it
|
||||||
is impossible to distinguish or to fully address the test.
|
is impossible to distinguish or to fully address the test.
|
||||||
\li \inlineimage icons/qtcreator-run-tests-in-current-file.png
|
\li \inlineimage icons/qtcreator-run-tests-in-current-file.png
|
||||||
(\uicontrol {Run Tests for Current File}) to run the tests
|
(\uicontrol {Run Tests for Current File}) to run the tests
|
||||||
@@ -338,7 +334,7 @@
|
|||||||
The functions to run tests are also available in the context menu in the
|
The functions to run tests are also available in the context menu in the
|
||||||
\uicontrol Tests view and in \uicontrol Tools > \uicontrol Tests.
|
\uicontrol Tests view and in \uicontrol Tools > \uicontrol Tests.
|
||||||
|
|
||||||
\note If you have enabled build system based and code based tests,
|
\note If you enable both build system based and code based tests,
|
||||||
you may run tests twice when using \uicontrol {Run All Tests} or
|
you may run tests twice when using \uicontrol {Run All Tests} or
|
||||||
\uicontrol {Run Selected Tests}. This happens if the tests can be
|
\uicontrol {Run Selected Tests}. This happens if the tests can be
|
||||||
found by the code based test frameworks and are registered as test
|
found by the code based test frameworks and are registered as test
|
||||||
@@ -356,8 +352,8 @@
|
|||||||
\image qtcreator-tests-view.png
|
\image qtcreator-tests-view.png
|
||||||
|
|
||||||
If a Qt Quick test case does not have a name, it is marked
|
If a Qt Quick test case does not have a name, it is marked
|
||||||
\uicontrol Unnamed in the list. Unnamed test cases are executed when you
|
\uicontrol Unnamed in the list. \uicontrol {Run All Tests} executes
|
||||||
select \uicontrol {Run All Tests}. You cannot select or deselect them.
|
unnamed test cases. You cannot select or deselect them.
|
||||||
|
|
||||||
\QC scans the project for tests when you open the project and updates the
|
\QC scans the project for tests when you open the project and updates the
|
||||||
test list for the currently active test frameworks when you edit tests.
|
test list for the currently active test frameworks when you edit tests.
|
||||||
@@ -369,8 +365,8 @@
|
|||||||
Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a
|
Cleanup Functions} or \uicontrol {Show Data Functions}. Double-click a
|
||||||
function in the list to open its source code in the code editor.
|
function in the list to open its source code in the code editor.
|
||||||
|
|
||||||
The test cases are listed in alphabetic, case insensitive order. To list
|
The \uicontrol Tests view lists test cases in alphabetic, case insensitive
|
||||||
them in the order in which they are defined in the source code,
|
order. To list them in the order in which they appear in the source code,
|
||||||
select \inlineimage icons/leafsort.png
|
select \inlineimage icons/leafsort.png
|
||||||
(\uicontrol {Sort Naturally}).
|
(\uicontrol {Sort Naturally}).
|
||||||
|
|
||||||
@@ -396,46 +392,52 @@
|
|||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
||||||
\uicontrol General.
|
\uicontrol General.
|
||||||
|
|
||||||
\image qtcreator-autotests-options.png "Testing General preferences"
|
\image qtcreator-preferences-testing-general.webp {General tab in Testing preferences}
|
||||||
|
|
||||||
You can customize some settings at project level. To change settings
|
You can customize some settings at project level. To change settings
|
||||||
for the current project instead of globally, select \uicontrol Projects >
|
for the current project instead of globally, select \uicontrol Projects >
|
||||||
\uicontrol {Project Settings} > \uicontrol {Testing}.
|
\uicontrol {Project Settings} > \uicontrol {Testing}.
|
||||||
|
|
||||||
In the \uicontrol {Active Test Frameworks} list you can select which tests
|
In the \uicontrol {Active Test Frameworks} list, select tests for \QC to
|
||||||
\QC will handle. To improve the performance of full scans for tests, disable
|
handle. To improve the performance of full scans for tests, disable
|
||||||
test frameworks you are not using.
|
test frameworks you do not use.
|
||||||
|
|
||||||
To group related test cases for an active test framework, select the
|
To group related test cases for an active test framework, select the
|
||||||
\uicontrol Group check box next to the framework name in the
|
\uicontrol Group check box next to the framework name in the
|
||||||
\uicontrol {Active Test Frameworks} list.
|
\uicontrol {Active Test Frameworks} list.
|
||||||
By default, tests are grouped based on the directory where they are located.
|
By default, \QC groups tests that are in the same directory.
|
||||||
|
|
||||||
Internal messages and run configuration warnings for deduced configurations
|
\QC omits internal messages and run configuration warnings for
|
||||||
are omitted by default. To view them, deselect the \uicontrol {Omit internal
|
deduced configurations by default. To view them, deselect the
|
||||||
messages} and \uicontrol {Omit run configuration warnings} check boxes.
|
\uicontrol {Omit internal messages} and
|
||||||
|
\uicontrol {Omit run configuration warnings} check boxes.
|
||||||
|
|
||||||
By default, test result output is limited to 100,000 characters. The view
|
By default, test result output shows a maximum of 100,000 characters. The
|
||||||
is automatically scrolled down when new results are added. To display
|
view automatically scrolls to show the latest results. To display
|
||||||
full results, deselect the \uicontrol {Limit result output} check box.
|
full results, deselect the \uicontrol {Limit result output} check box.
|
||||||
To disable automatic scrolling, deselect the
|
To disable automatic scrolling, deselect the
|
||||||
\uicontrol {Automatically scroll results} check box.
|
\uicontrol {Automatically scroll results} check box.
|
||||||
|
|
||||||
Test results can be grouped by the executable path that was used to run the
|
Set the maximum number of lines in the test result tooltip and description
|
||||||
tests. This is useful if you have multiple test executables and run them all
|
in \uicontrol {Limit result description}.
|
||||||
at once. To enable this functionality you need to select the
|
|
||||||
\uicontrol {Group results by application} check box.
|
|
||||||
|
|
||||||
It is possible to automatically run the currently available tests after
|
To group test results by the executable path that you use to run the
|
||||||
successfully building the current project. In \uicontrol {Automatically run},
|
tests, select \uicontrol {Group results by application}. This is useful
|
||||||
select which tests should be run after a successful build.
|
if you have multiple test executables and run them all at once.
|
||||||
|
|
||||||
In some special setups, \QC cannot deduce which executable or run
|
To automatically run tests after successfully building the current project,
|
||||||
configuration it should use. If \QC repeatedly asks you to select the
|
select them in \uicontrol {Automatically run}.
|
||||||
tests to run when trying to execute tests, you can enable it to cache
|
|
||||||
your choices and use them were appropriate. The cached information is
|
Sometimes, \QC cannot deduce which executable or run configuration to use.
|
||||||
cleared when you switch to another project, close the current one, or
|
If \QC repeatedly asks you to select the tests to run when trying to execute
|
||||||
select \uicontrol {Reset Cached Choices}.
|
tests, you can let it cache your choices and use them where appropriate. \QC
|
||||||
|
clears the cache when you switch to another project, close the current one,
|
||||||
|
or select \uicontrol {Reset Cached Choices}.
|
||||||
|
|
||||||
|
Select the \uicontrol {Process arguments} check box to pass arguments to the
|
||||||
|
test executable that you specify in the \l {Managing Run Configurations}
|
||||||
|
{run configuration}. This is an experimental feature that might cause the
|
||||||
|
execution of the test executable to fail.
|
||||||
|
|
||||||
\section2 Specifying Settings for Running Qt Tests
|
\section2 Specifying Settings for Running Qt Tests
|
||||||
|
|
||||||
@@ -447,7 +449,7 @@
|
|||||||
walltime, CPU tick counter, event counter, Valgrind Callgrind, and Linux
|
walltime, CPU tick counter, event counter, Valgrind Callgrind, and Linux
|
||||||
Perf. For more information, see \l{Creating a Benchmark}.
|
Perf. For more information, see \l{Creating a Benchmark}.
|
||||||
|
|
||||||
\image qtcreator-autotests-options-qt.png
|
\image qtcreator-preferences-testing-qttest.webp {Qt Tests tab in Testing preferences}
|
||||||
|
|
||||||
To receive verbose output when running benchmarks, select the
|
To receive verbose output when running benchmarks, select the
|
||||||
\uicontrol {Verbose benchmarks} check box.
|
\uicontrol {Verbose benchmarks} check box.
|
||||||
@@ -459,13 +461,13 @@
|
|||||||
\uicontrol {Log signals and slots} check box.
|
\uicontrol {Log signals and slots} check box.
|
||||||
|
|
||||||
To explicitly limit the maximum number of warnings in the test log, select
|
To explicitly limit the maximum number of warnings in the test log, select
|
||||||
the \uicontrol {Limit warnings} check box and specify the intended number
|
the \uicontrol {Limit warnings} check box and set the limit. Set it to 0 if
|
||||||
inside the spin box next to it. Set the number to 0 if you want no limit
|
you want no limit at all. The default number is 2000.
|
||||||
at all. The default number is 2000.
|
|
||||||
|
|
||||||
To check for Qt Quick Tests that are derived from TestCase select the
|
To check for Qt Quick Tests that are derived from TestCase, select the
|
||||||
\uicontrol {Check for derived Qt Quick tests} check box.
|
\uicontrol {Check for derived Qt Quick tests} check box.
|
||||||
Note: this feature is rather expensive and will increase the
|
|
||||||
|
\note This feature is rather expensive and increases the
|
||||||
scan time significantly.
|
scan time significantly.
|
||||||
|
|
||||||
\section2 Specifying Settings for Running Google Tests
|
\section2 Specifying Settings for Running Google Tests
|
||||||
@@ -473,24 +475,24 @@
|
|||||||
To specify settings for running Google tests, select \uicontrol Edit >
|
To specify settings for running Google tests, select \uicontrol Edit >
|
||||||
\uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Google Test}.
|
\uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Google Test}.
|
||||||
|
|
||||||
\image qtcreator-autotests-options-google.png
|
\image qtcreator-preferences-testing-googletest.webp {Gooble Test tab in Testing preferences}
|
||||||
|
|
||||||
To run disabled tests, select the \uicontrol {Run disabled tests} check box.
|
To run disabled tests, select the \uicontrol {Run disabled tests} check box.
|
||||||
|
|
||||||
To run several iterations of the tests, select the \uicontrol {Repeat tests}
|
To run several iterations of the tests, select the \uicontrol {Repeat tests}
|
||||||
check box and enter the number of times the tests should be run in the
|
check box and enter the number of times to run the tests in the
|
||||||
\uicontrol Iterations field. To make sure that the tests are independent and
|
\uicontrol Iterations field. To make sure that the tests are independent and
|
||||||
repeatable, you can run them in a different order each time by selecting the
|
repeatable, run them in a different order each time by selecting the
|
||||||
\uicontrol {Shuffle tests} check box.
|
\uicontrol {Shuffle tests} check box. Set the seed for initializing the
|
||||||
|
randomizer in the \uicontrol Seed field. The value 0 generates a seed
|
||||||
|
based on the current timestamp.
|
||||||
|
|
||||||
To turn failures into debugger breakpoints, select the
|
To turn failures into debugger breakpoints, select the
|
||||||
\uicontrol {Break on failure while debugging} check box. To turn assertion
|
\uicontrol {Break on failure while debugging} check box.
|
||||||
failures into C++ exceptions, select the \uicontrol {Throw on failure} check
|
|
||||||
box.
|
|
||||||
|
|
||||||
To group Google tests by using a GTest filter, select
|
To group Google tests by using a GTest filter, select
|
||||||
\uicontrol {GTest Filter} in the \uicontrol {Group mode} field,
|
\uicontrol {GTest Filter} in the \uicontrol {Group mode} field,
|
||||||
and specify the filter to use in the \uicontrol {Active filter}
|
and specify the filter in the \uicontrol {Active filter}
|
||||||
field. For more information about GTest filters, see
|
field. For more information about GTest filters, see
|
||||||
\l{https://github.com/google/googletest/blob/master/docs/advanced.md#running-a-subset-of-the-tests}
|
\l{https://github.com/google/googletest/blob/master/docs/advanced.md#running-a-subset-of-the-tests}
|
||||||
{Running a Subset of the Tests}.
|
{Running a Subset of the Tests}.
|
||||||
@@ -501,16 +503,18 @@
|
|||||||
\li To specify settings for running Boost tests, select \uicontrol Edit
|
\li To specify settings for running Boost tests, select \uicontrol Edit
|
||||||
> \uicontrol Preferences > \uicontrol {Testing} >
|
> \uicontrol Preferences > \uicontrol {Testing} >
|
||||||
\uicontrol {Boost Test}.
|
\uicontrol {Boost Test}.
|
||||||
\image qtcreator-autotests-options-boost.png
|
\image qtcreator-preferences-testing-boosttest.webp {Boost Test tab in Testing preferences}
|
||||||
\li In the \uicontrol {Log format} field, select the error report
|
\li In the \uicontrol {Log format} field, select the error report
|
||||||
format to specify the type of events you want recorded in the
|
format to specify the type of events to record in the
|
||||||
test report.
|
test report.
|
||||||
\li In the \uicontrol {Report level} field, select the verbosity level
|
\li In the \uicontrol {Report level} field, select the verbosity level
|
||||||
of the test result report. Select \uicontrol No if you do not want
|
of the test result report. Select \uicontrol No if you do not want
|
||||||
a report.
|
a report.
|
||||||
\li Select the \uicontrol Randomize check box to execute the tests in
|
\li Select the \uicontrol Randomize check box to execute the tests in
|
||||||
a random order, using the seed specified in the \uicontrol Seed
|
a random order, using the seed specified in the \uicontrol Seed
|
||||||
field for initializing the randomizer.
|
field for initializing the randomizer. The value 0 means no
|
||||||
|
randomization, the value 1 uses the current time, and any other
|
||||||
|
value generates a random seed.
|
||||||
\li Select the \uicontrol {Catch system errors} check box to catch
|
\li Select the \uicontrol {Catch system errors} check box to catch
|
||||||
system errors.
|
system errors.
|
||||||
\li Select the \uicontrol {Floating point exceptions} check box to
|
\li Select the \uicontrol {Floating point exceptions} check box to
|
||||||
@@ -524,7 +528,7 @@
|
|||||||
\li To specify settings for running Catch2 tests, select
|
\li To specify settings for running Catch2 tests, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
||||||
\uicontrol {Catch Test}.
|
\uicontrol {Catch Test}.
|
||||||
\image qtcreator-autotests-options-catch2.png "Catch Test preferences"
|
\image qtcreator-preferences-testing-catchtest.webp {Catch Test tab in Testing preferences}
|
||||||
\li Select the \uicontrol {Show success} check box to show succeeding
|
\li Select the \uicontrol {Show success} check box to show succeeding
|
||||||
expressions as well. By default Catch2 will print only fails.
|
expressions as well. By default Catch2 will print only fails.
|
||||||
\li Select the \uicontrol {Break on failure while debugging} check box
|
\li Select the \uicontrol {Break on failure while debugging} check box
|
||||||
@@ -538,16 +542,15 @@
|
|||||||
\li Select the \uicontrol {Abort after} check box to abort the test
|
\li Select the \uicontrol {Abort after} check box to abort the test
|
||||||
after the number of failures specified inside the spin box.
|
after the number of failures specified inside the spin box.
|
||||||
\li Select the \uicontrol {Benchmark samples} check box to specify
|
\li Select the \uicontrol {Benchmark samples} check box to specify
|
||||||
the number of samples to be collected while running benchmarks.
|
the number of samples to collect while running benchmarks.
|
||||||
\li Select the \uicontrol {Benchmark resamples} check box to specify
|
\li Select the \uicontrol {Benchmark resamples} check box to specify
|
||||||
the number of resamples to be used for the statistical
|
the number of resamples to use for statistical bootstrapping after
|
||||||
bootstrapping performed after the benchmarking.
|
benchmarking.
|
||||||
\li Select the \uicontrol {Benchmark confidence interval} check box
|
\li Select the \uicontrol {Benchmark confidence interval} check box
|
||||||
to specify the confidence interval used for the statistical
|
to specify the confidence interval for statistical bootstrapping.
|
||||||
bootstrapping.
|
|
||||||
\li Select the \uicontrol {Benchmark warmup time} check box to specify
|
\li Select the \uicontrol {Benchmark warmup time} check box to specify
|
||||||
the warmup time for each test before benchmarking start.
|
the warmup time for each test before benchmarking starts.
|
||||||
\li Select the \uicontrol {Disable analysis} check box to disable the
|
\li Select the \uicontrol {Disable analysis} check box to disable
|
||||||
statistical analysis and bootstrapping.
|
statistical analysis and bootstrapping.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -556,7 +559,7 @@
|
|||||||
\li To specify settings for running CTest-based tests, select
|
\li To specify settings for running CTest-based tests, select
|
||||||
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
\uicontrol Edit > \uicontrol Preferences > \uicontrol {Testing} >
|
||||||
\uicontrol {CTest}.
|
\uicontrol {CTest}.
|
||||||
\image qtcreator-autotests-options-ctest.png "CTest preferences"
|
\image qtcreator-preferences-testing-ctest.webp {CTest tab in Testing preferences}
|
||||||
\li Select the \uicontrol {Output on failure} check box to show test
|
\li Select the \uicontrol {Output on failure} check box to show test
|
||||||
specific output if a test fails. Contrary to the CTest default
|
specific output if a test fails. Contrary to the CTest default
|
||||||
this is enabled by default.
|
this is enabled by default.
|
||||||
@@ -570,30 +573,37 @@
|
|||||||
\li Select \uicontrol {Repeat tests} if you want to re-run tests
|
\li Select \uicontrol {Repeat tests} if you want to re-run tests
|
||||||
under certain circumstances.
|
under certain circumstances.
|
||||||
\li In the \uicontrol {Repetition mode} field, select the mode for
|
\li In the \uicontrol {Repetition mode} field, select the mode for
|
||||||
re-running tests. The maximum count for repeating a test can be
|
re-running tests. Set the maximum count for repeating a test in
|
||||||
specified in the \uicontrol {Count} field.
|
the \uicontrol {Count} field.
|
||||||
\li Select \uicontrol {Run in parallel} to run the tests in parallel
|
\li Select \uicontrol {Run in parallel} to run the tests in parallel
|
||||||
using the specified number of \uicontrol {Jobs}.
|
using the specified number of \uicontrol {Jobs}.
|
||||||
\li Select \uicontrol {Test load} to be able to limit the parallel
|
\li Select \uicontrol {Test load} to limit the parallel
|
||||||
execution. CTest will not start a new test if it would cause the
|
execution. CTest will not start a new test if it would cause the
|
||||||
CPU load to pass the threshold given in \uicontrol {Threshold}.
|
CPU load to pass the threshold set in \uicontrol {Threshold}.
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\section1 Viewing Test Output
|
\section1 Viewing Test Output
|
||||||
|
|
||||||
The test results are displayed in \l{Viewing Output}{Test Results}
|
The \l{Viewing Output}{Test Results} view shows Qt and Qt Quick test results
|
||||||
in XML format. XML can be parsed more easily and reliably than plain text.
|
in XML format and other test results in plain text format.
|
||||||
|
|
||||||
However, if a Qt test crashes, it might not produce complete XML code that
|
\section2 Qt Test Output
|
||||||
can be parsed, which might lead to information loss. The lost information
|
|
||||||
might be retrievable when viewing the results as plain text.
|
XML can be parsed more easily and reliably than plain text. However, if a Qt
|
||||||
To view the results of Qt tests as plain text, select \uicontrol Edit >
|
or Qt Quick test crashes, it might not produce complete XML
|
||||||
|
code that can be parsed, which might lead to information loss. You might see
|
||||||
|
the lost information when viewing the results as plain text.
|
||||||
|
|
||||||
|
To view the
|
||||||
|
results of Qt and Qt Quick tests as plain text, select \uicontrol Edit >
|
||||||
\uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Qt Test}, and
|
\uicontrol Preferences > \uicontrol {Testing} > \uicontrol {Qt Test}, and
|
||||||
then deselect the \uicontrol {Use XML output} check box. Then select the
|
then deselect the \uicontrol {Use XML output} check box. Then select the
|
||||||
\inlineimage icons/text.png
|
\inlineimage icons/text.png
|
||||||
(\uicontrol {Switch Between Visual and Text Display}) button in
|
(\uicontrol {Switch Between Visual and Text Display}) button in
|
||||||
\uicontrol {Test Results} to switch to the text display.
|
\uicontrol {Test Results} to switch to the text display.
|
||||||
|
|
||||||
|
\section2 Summary of Messages
|
||||||
|
|
||||||
The following table lists the messages that \uicontrol {Test Results}
|
The following table lists the messages that \uicontrol {Test Results}
|
||||||
displays:
|
displays:
|
||||||
|
|
||||||
@@ -643,6 +653,12 @@
|
|||||||
|
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
To view only messages of a particular type, select
|
||||||
|
\inlineimage icons/filtericon.png
|
||||||
|
(\uicontrol {Filter Test Results}), and then select the types of messages to
|
||||||
|
show. To show all messages, select \uicontrol {Check All Filters}. To
|
||||||
|
deselect all message types, select \uicontrol {Uncheck All Filters}.
|
||||||
|
|
||||||
Since Qt 5.4, you can add a BLACKLIST file for tests. It is mainly used
|
Since Qt 5.4, you can add a BLACKLIST file for tests. It is mainly used
|
||||||
internally by the Qt CI system.
|
internally by the Qt CI system.
|
||||||
|
|
||||||
@@ -664,10 +680,4 @@
|
|||||||
\li Blacklisted test case passed even though it was expected to fail.
|
\li Blacklisted test case passed even though it was expected to fail.
|
||||||
|
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
To view only messages of a particular type, select
|
|
||||||
\inlineimage icons/filtericon.png
|
|
||||||
(\uicontrol {Filter Test Results}), and then select the types of messages to
|
|
||||||
show. To show all messages, select \uicontrol {Check All Filters}. To
|
|
||||||
deselect all message types, select \uicontrol {Uncheck All Filters}.
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
\b {How do I generate a core file in \QC?}
|
\b {How do I generate a core file in \QC?}
|
||||||
|
|
||||||
To trigger the GDB command that generates a core file while debugging,
|
To trigger the GDB command that generates a core file while debugging,
|
||||||
select \uicontrol View > \uicontrol Views > \uicontrol {Debugger Log}.
|
select \uicontrol View > \uicontrol Views > \l {Debugger Log}.
|
||||||
In the \uicontrol Command field, type \c gcore and press \key Enter. The
|
In the \uicontrol Command field, type \c gcore and press \key Enter. The
|
||||||
core file is created in the current working directory. You can specify
|
core file is created in the current working directory. You can specify
|
||||||
another location for the file, including a relative or absolute path, as an
|
another location for the file, including a relative or absolute path, as an
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (C) 2022 The Qt Company Ltd.
|
// Copyright (C) 2023 The Qt Company Ltd.
|
||||||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
|
||||||
|
|
||||||
// **********************************************************************
|
// **********************************************************************
|
||||||
@@ -30,11 +30,12 @@
|
|||||||
\li \l{https://doc.qt.io/Boot2Qt/b2qt-installation-guides.html}
|
\li \l{https://doc.qt.io/Boot2Qt/b2qt-installation-guides.html}
|
||||||
{Boot2Qt Device} (commercial only)
|
{Boot2Qt Device} (commercial only)
|
||||||
\li \l{Emulator}{Boot2Qt Emulator Device} (commercial only)
|
\li \l{Emulator}{Boot2Qt Emulator Device} (commercial only)
|
||||||
\li \l{Connecting Remote Linux Devices}{Remote Linux Device}
|
\li \l{Adding Docker Devices}{Docker Device} (experimental)
|
||||||
\li \l{Connecting iOS Devices}{iOS Device}
|
\li \l{Connecting iOS Devices}{iOS Device}
|
||||||
\li iOS Simulator
|
\li iOS Simulator
|
||||||
\li \l{Connecting MCUs}{MCU Device} (commercial only)
|
\li \l{Connecting MCUs}{MCU Device} (commercial only)
|
||||||
\li \l{Connecting QNX Devices}{QNX Device}
|
\li \l{Connecting QNX Devices}{QNX Device}
|
||||||
|
\li \l{Connecting Remote Linux Devices}{Remote Linux Device}
|
||||||
\li \l{Building Applications for the Web}{WebAssembly Runtime}
|
\li \l{Building Applications for the Web}{WebAssembly Runtime}
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,7 @@
|
|||||||
\li \l{Local Variables and Function Parameters}
|
\li \l{Local Variables and Function Parameters}
|
||||||
\li \l{Evaluating Expressions}
|
\li \l{Evaluating Expressions}
|
||||||
\li \l{Viewing and Editing Register State}
|
\li \l{Viewing and Editing Register State}
|
||||||
\li \l{Directly Interacting with Native Debuggers}
|
\li \l{Debugger Log}
|
||||||
\li \l{Viewing Disassembled Code}
|
\li \l{Viewing Disassembled Code}
|
||||||
\li
|
\li
|
||||||
\endlist
|
\endlist
|
||||||
|
|||||||
@@ -413,7 +413,7 @@
|
|||||||
provides them with functions for managing the information.
|
provides them with functions for managing the information.
|
||||||
Available in \uicontrol Debug mode, for interaction with the program
|
Available in \uicontrol Debug mode, for interaction with the program
|
||||||
that is running under the control of the debugger.
|
that is running under the control of the debugger.
|
||||||
\image qtcreator-debugger-views.png "Views"
|
\image qtcreator-debugger-views.webp "Views"
|
||||||
\li Use descriptive names for views.
|
\li Use descriptive names for views.
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,8 @@ set(CPACK_PACKAGE_CONTACT "None")
|
|||||||
set(CPACK_THREADS 4)
|
set(CPACK_THREADS 4)
|
||||||
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
set(CPACK_DEBIAN_ARCHITECTURE ${CMAKE_SYSTEM_PROCESSOR})
|
||||||
set(CPACK_DEBIAN_COMPRESSION_TYPE lzma)
|
set(CPACK_DEBIAN_COMPRESSION_TYPE lzma)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_RELEASE 1)
|
||||||
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Qt Project <qt-creator@qt-project.org>")
|
||||||
|
|
||||||
# Make CMAKE_INSTALL_DEFAULT_COMPONENT_NAME the first component to install
|
# Make CMAKE_INSTALL_DEFAULT_COMPONENT_NAME the first component to install
|
||||||
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
|
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
|
||||||
|
|||||||
@@ -174,9 +174,10 @@ Item {
|
|||||||
id: dragger
|
id: dragger
|
||||||
property int visualIndex: labelContainer.visualIndex
|
property int visualIndex: labelContainer.visualIndex
|
||||||
width: labelContainer.width
|
width: labelContainer.width
|
||||||
height: 0
|
height: labelContainer.height
|
||||||
color: Theme.color(Theme.PanelStatusBarBackgroundColor)
|
color: Theme.color(Theme.PanelStatusBarBackgroundColor)
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
|
visible: Drag.active
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
|
||||||
// anchor to top so that it reliably snaps back after dragging
|
// anchor to top so that it reliably snaps back after dragging
|
||||||
@@ -184,16 +185,13 @@ Item {
|
|||||||
|
|
||||||
Drag.active: dragArea.drag.active
|
Drag.active: dragArea.drag.active
|
||||||
Drag.onActiveChanged: {
|
Drag.onActiveChanged: {
|
||||||
// We don't want height or text to be changed when reordering occurs, so we don't make
|
// We don't want text to be changed when reordering occurs, so we don't make
|
||||||
// them properties.
|
// it a property
|
||||||
draggerText.text = txt.text;
|
draggerText.text = txt.text;
|
||||||
if (Drag.active) {
|
if (Drag.active)
|
||||||
height = labelContainer.height;
|
|
||||||
labelContainer.dragStarted();
|
labelContainer.dragStarted();
|
||||||
} else {
|
else
|
||||||
height = 0;
|
|
||||||
labelContainer.dragStopped();
|
labelContainer.dragStopped();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
states: [
|
states: [
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ DeviceShell::~DeviceShell()
|
|||||||
*/
|
*/
|
||||||
RunResult DeviceShell::runInShell(const CommandLine &cmd, const QByteArray &stdInData)
|
RunResult DeviceShell::runInShell(const CommandLine &cmd, const QByteArray &stdInData)
|
||||||
{
|
{
|
||||||
QTC_ASSERT(m_shellProcess, return {});
|
|
||||||
Q_ASSERT(QThread::currentThread() != &m_thread);
|
Q_ASSERT(QThread::currentThread() != &m_thread);
|
||||||
|
|
||||||
return run(cmd, stdInData);
|
return run(cmd, stdInData);
|
||||||
@@ -75,7 +74,7 @@ QStringList DeviceShell::missingFeatures() const { return m_missingFeatures; }
|
|||||||
RunResult DeviceShell::run(const CommandLine &cmd, const QByteArray &stdInData)
|
RunResult DeviceShell::run(const CommandLine &cmd, const QByteArray &stdInData)
|
||||||
{
|
{
|
||||||
// If the script failed to install, use QtcProcess directly instead.
|
// If the script failed to install, use QtcProcess directly instead.
|
||||||
bool useProcess = m_shellScriptState == State::NoScript;
|
bool useProcess = m_shellScriptState == State::Failed;
|
||||||
|
|
||||||
// Transferring large amounts of stdInData is slow via the shell script.
|
// Transferring large amounts of stdInData is slow via the shell script.
|
||||||
// Use QtcProcess directly if the size exceeds 100kb.
|
// Use QtcProcess directly if the size exceeds 100kb.
|
||||||
@@ -198,10 +197,7 @@ bool DeviceShell::start()
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!installShellScript()) {
|
if (installShellScript()) {
|
||||||
if (m_shellScriptState == State::FailedToStart)
|
|
||||||
closeShellProcess();
|
|
||||||
} else {
|
|
||||||
connect(m_shellProcess.get(),
|
connect(m_shellProcess.get(),
|
||||||
&QtcProcess::readyReadStandardOutput,
|
&QtcProcess::readyReadStandardOutput,
|
||||||
m_shellProcess.get(),
|
m_shellProcess.get(),
|
||||||
@@ -214,6 +210,10 @@ bool DeviceShell::start()
|
|||||||
qCWarning(deviceShellLog)
|
qCWarning(deviceShellLog)
|
||||||
<< "Received unexpected output on stderr:" << stdErr;
|
<< "Received unexpected output on stderr:" << stdErr;
|
||||||
});
|
});
|
||||||
|
} else if (m_shellProcess->isRunning()) {
|
||||||
|
m_shellProcess->kill();
|
||||||
|
m_shellProcess.reset();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(m_shellProcess.get(), &QtcProcess::done, m_shellProcess.get(), [this] {
|
connect(m_shellProcess.get(), &QtcProcess::done, m_shellProcess.get(), [this] {
|
||||||
@@ -248,7 +248,7 @@ bool DeviceShell::checkCommand(const QByteArray &command)
|
|||||||
}
|
}
|
||||||
QByteArray out = m_shellProcess->readAllRawStandardOutput();
|
QByteArray out = m_shellProcess->readAllRawStandardOutput();
|
||||||
if (out.contains("<missing>")) {
|
if (out.contains("<missing>")) {
|
||||||
m_shellScriptState = State::NoScript;
|
m_shellScriptState = State::Failed;
|
||||||
qCWarning(deviceShellLog) << "Command" << command << "was not found";
|
qCWarning(deviceShellLog) << "Command" << command << "was not found";
|
||||||
m_missingFeatures.append(QString::fromUtf8(command));
|
m_missingFeatures.append(QString::fromUtf8(command));
|
||||||
return false;
|
return false;
|
||||||
@@ -260,7 +260,7 @@ bool DeviceShell::checkCommand(const QByteArray &command)
|
|||||||
bool DeviceShell::installShellScript()
|
bool DeviceShell::installShellScript()
|
||||||
{
|
{
|
||||||
if (m_forceFailScriptInstallation) {
|
if (m_forceFailScriptInstallation) {
|
||||||
m_shellScriptState = State::NoScript;
|
m_shellScriptState = State::Failed;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -291,15 +291,19 @@ bool DeviceShell::installShellScript()
|
|||||||
}
|
}
|
||||||
|
|
||||||
QByteArray out = m_shellProcess->readAllRawStandardError();
|
QByteArray out = m_shellProcess->readAllRawStandardError();
|
||||||
if (out.contains("SCRIPT_INSTALLED")) {
|
if (out.contains("SCRIPT_INSTALLED") && !out.contains("ERROR_INSTALL_SCRIPT")) {
|
||||||
m_shellScriptState = State::Succeeded;
|
m_shellScriptState = State::Succeeded;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (out.contains("ERROR_INSTALL_SCRIPT")) {
|
if (out.contains("ERROR_INSTALL_SCRIPT")) {
|
||||||
m_shellScriptState = State::NoScript;
|
m_shellScriptState = State::Failed;
|
||||||
qCWarning(deviceShellLog) << "Failed installing device shell script";
|
qCWarning(deviceShellLog) << "Failed installing device shell script";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
if (!out.isEmpty()) {
|
||||||
|
qCWarning(deviceShellLog)
|
||||||
|
<< "Unexpected output while installing device shell script:" << out;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ class QTCREATOR_UTILS_EXPORT DeviceShell : public QObject
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
enum class State { FailedToStart = -1, Unknown = 0, Succeeded = 1, NoScript = 2 };
|
enum class State { Failed = -1, Unknown = 0, Succeeded = 1 };
|
||||||
|
|
||||||
enum class ParseType {
|
enum class ParseType {
|
||||||
StdOut,
|
StdOut,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) 2022 The Qt Company Ltd.
|
# Copyright (C) 2022 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
FINAL_OUT=$(mktemp -u)
|
FINAL_OUT=$(mktemp -u) || exit 2
|
||||||
mkfifo "$FINAL_OUT"
|
mkfifo "$FINAL_OUT" || exit 3
|
||||||
|
|
||||||
finalOutput() {
|
finalOutput() {
|
||||||
local fileInputBuffer
|
local fileInputBuffer
|
||||||
|
|||||||
@@ -646,6 +646,7 @@ void AndroidDeviceManager::setupDevicesWatcher()
|
|||||||
|
|
||||||
const CommandLine command = CommandLine(m_androidConfig.adbToolPath(), {"track-devices"});
|
const CommandLine command = CommandLine(m_androidConfig.adbToolPath(), {"track-devices"});
|
||||||
m_adbDeviceWatcherProcess->setCommand(command);
|
m_adbDeviceWatcherProcess->setCommand(command);
|
||||||
|
m_adbDeviceWatcherProcess->setWorkingDirectory(command.executable().parentDir());
|
||||||
m_adbDeviceWatcherProcess->setEnvironment(AndroidConfigurations::toolsEnvironment(m_androidConfig));
|
m_adbDeviceWatcherProcess->setEnvironment(AndroidConfigurations::toolsEnvironment(m_androidConfig));
|
||||||
m_adbDeviceWatcherProcess->start();
|
m_adbDeviceWatcherProcess->start();
|
||||||
|
|
||||||
|
|||||||
@@ -2285,9 +2285,9 @@ void CdbEngine::parseOutputLine(QString line)
|
|||||||
CheckableMessageBox::doNotShowAgainInformation(
|
CheckableMessageBox::doNotShowAgainInformation(
|
||||||
Core::ICore::dialogParent(),
|
Core::ICore::dialogParent(),
|
||||||
Tr::tr("Debugger Start Failed"),
|
Tr::tr("Debugger Start Failed"),
|
||||||
Tr::tr("The system prevents loading of %1 which is required for debugging. "
|
Tr::tr("The system prevents loading of %1, which is required for debugging. "
|
||||||
"Make sure that your antivirus solution is up to date and if that does not work "
|
"Make sure that your antivirus solution is up to date and if that does not work "
|
||||||
"consider to add an exception for %1.")
|
"consider adding an exception for %1.")
|
||||||
.arg(m_extensionFileName),
|
.arg(m_extensionFileName),
|
||||||
Core::ICore::settings(),
|
Core::ICore::settings(),
|
||||||
"SecureInfoCdbextCannotBeLoaded");
|
"SecureInfoCdbextCannotBeLoaded");
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public:
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
const Position start = m_item.selectionRange().start();
|
const Position start = m_item.selectionRange().start();
|
||||||
return QVariant::fromValue(
|
return QVariant::fromValue(
|
||||||
Link(m_client->serverUriToHostPath(m_item.uri()), start.line(), start.character()));
|
Link(m_client->serverUriToHostPath(m_item.uri()), start.line() + 1, start.character()));
|
||||||
}
|
}
|
||||||
case AnnotationRole:
|
case AnnotationRole:
|
||||||
if (const std::optional<QString> detail = m_item.detail())
|
if (const std::optional<QString> detail = m_item.detail())
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
using CMakeProjectManager::CMakeConfig;
|
using CMakeProjectManager::CMakeConfig;
|
||||||
using CMakeProjectManager::CMakeConfigItem;
|
using CMakeProjectManager::CMakeConfigItem;
|
||||||
@@ -721,5 +722,68 @@ void removeOutdatedKits()
|
|||||||
KitManager::deregisterKit(kit);
|
KitManager::deregisterKit(kit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* using kitQmlImportPath of kit found in profile.xml to get the path to Qul
|
||||||
|
* installation where description file (.json) of the kit is located.
|
||||||
|
*/
|
||||||
|
static const FilePaths kitsFiles(const Kit *kit)
|
||||||
|
{
|
||||||
|
const FilePath qulRoot = kitDependencyPath(kit, Legacy::Constants::QUL_CMAKE_VAR);
|
||||||
|
return kitsPath(qulRoot).dirEntries(Utils::FileFilter({"*.json"}, QDir::Files));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* When file description (.json) of a kit exists in the Qul installation that means
|
||||||
|
* target is installed.
|
||||||
|
*/
|
||||||
|
static bool anyKitDescriptionFileExists(const FilePaths &jsonFiles,
|
||||||
|
const QStringList &kitsProperties)
|
||||||
|
{
|
||||||
|
static const QRegularExpression re("(\\w+)-(\\w+)-(.+)\\.json");
|
||||||
|
for (const FilePath &jsonFile : jsonFiles) {
|
||||||
|
const QRegularExpressionMatch match = re.match(jsonFile.fileName());
|
||||||
|
QStringList kitsPropertiesFromFileName;
|
||||||
|
if (match.hasMatch()) {
|
||||||
|
const QString toolchain = match.captured(1).replace(
|
||||||
|
"gnu", "gcc"); // kitFileName contains gnu while profiles.xml contains gcc
|
||||||
|
const QString vendor = match.captured(2);
|
||||||
|
const QString device = match.captured(3);
|
||||||
|
|
||||||
|
kitsPropertiesFromFileName << toolchain << vendor << device;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (kitsPropertiesFromFileName == kitsProperties)
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QList<Kit *> findUninstalledTargetsKits()
|
||||||
|
{
|
||||||
|
QList<Kit *> uninstalledTargetsKits;
|
||||||
|
for (Kit *kit : KitManager::kits()) {
|
||||||
|
if (!kit->hasValue(Constants::KIT_MCUTARGET_KITVERSION_KEY))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
const QStringList kitsProperties = {
|
||||||
|
kit->value(Constants::KIT_MCUTARGET_TOOLCHAIN_KEY).toString().toLower(),
|
||||||
|
kit->value(Constants::KIT_MCUTARGET_VENDOR_KEY).toString().toLower(),
|
||||||
|
kit->value(Constants::KIT_MCUTARGET_MODEL_KEY).toString().toLower(),
|
||||||
|
};
|
||||||
|
|
||||||
|
const FilePaths kitsDescriptionFiles = kitsFiles(kit);
|
||||||
|
if (!anyKitDescriptionFileExists(kitsDescriptionFiles, kitsProperties))
|
||||||
|
uninstalledTargetsKits << kit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return uninstalledTargetsKits;
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeUninstalledTargetsKits(const QList<Kit *> uninstalledTargetsKits)
|
||||||
|
{
|
||||||
|
for (const auto &kit : uninstalledTargetsKits)
|
||||||
|
KitManager::deregisterKit(kit);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace McuKitManager
|
} // namespace McuKitManager
|
||||||
} // namespace McuSupport::Internal
|
} // namespace McuSupport::Internal
|
||||||
|
|||||||
@@ -56,6 +56,10 @@ void fixExistingKits(const SettingsHandler::Ptr &);
|
|||||||
// Outdated kits:
|
// Outdated kits:
|
||||||
void removeOutdatedKits();
|
void removeOutdatedKits();
|
||||||
|
|
||||||
|
// kits for uninstalled targets:
|
||||||
|
const QList<ProjectExplorer::Kit *> findUninstalledTargetsKits();
|
||||||
|
void removeUninstalledTargetsKits(const QList<ProjectExplorer::Kit *> uninstalledTargetsKits);
|
||||||
|
|
||||||
} // namespace McuKitManager
|
} // namespace McuKitManager
|
||||||
} // namespace McuSupport::Internal
|
} // namespace McuSupport::Internal
|
||||||
|
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ void McuSupportPlugin::extensionsInitialized()
|
|||||||
McuKitManager::createAutomaticKits(dd->m_settingsHandler);
|
McuKitManager::createAutomaticKits(dd->m_settingsHandler);
|
||||||
McuKitManager::fixExistingKits(dd->m_settingsHandler);
|
McuKitManager::fixExistingKits(dd->m_settingsHandler);
|
||||||
askUserAboutMcuSupportKitsSetup();
|
askUserAboutMcuSupportKitsSetup();
|
||||||
|
askUserAboutRemovingUninstalledTargetsKits();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,4 +189,34 @@ void McuSupportPlugin::askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::
|
|||||||
ICore::infoBar()->addInfo(info);
|
ICore::infoBar()->addInfo(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // McuSupport::Internal
|
void McuSupportPlugin::askUserAboutRemovingUninstalledTargetsKits()
|
||||||
|
{
|
||||||
|
const char removeUninstalledKits[] = "RemoveUninstalledKits";
|
||||||
|
QList<Kit *> uninstalledTargetsKits;
|
||||||
|
|
||||||
|
if (!ICore::infoBar()->canInfoBeAdded(removeUninstalledKits)
|
||||||
|
|| (uninstalledTargetsKits = McuKitManager::findUninstalledTargetsKits()).isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
Utils::InfoBarEntry
|
||||||
|
info(removeUninstalledKits,
|
||||||
|
Tr::tr("Detected %n uninstalled MCU target(s). Remove corresponding kits?",
|
||||||
|
nullptr,
|
||||||
|
uninstalledTargetsKits.size()),
|
||||||
|
Utils::InfoBarEntry::GlobalSuppression::Enabled);
|
||||||
|
|
||||||
|
info.addCustomButton(Tr::tr("Keep"), [removeUninstalledKits] {
|
||||||
|
ICore::infoBar()->removeInfo(removeUninstalledKits);
|
||||||
|
});
|
||||||
|
|
||||||
|
info.addCustomButton(Tr::tr("Remove"), [removeUninstalledKits, uninstalledTargetsKits] {
|
||||||
|
ICore::infoBar()->removeInfo(removeUninstalledKits);
|
||||||
|
QTimer::singleShot(0, [uninstalledTargetsKits]() {
|
||||||
|
McuKitManager::removeUninstalledTargetsKits(uninstalledTargetsKits);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
ICore::infoBar()->addInfo(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace McuSupport::Internal
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ public:
|
|||||||
|
|
||||||
void askUserAboutMcuSupportKitsSetup();
|
void askUserAboutMcuSupportKitsSetup();
|
||||||
static void askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::Ptr &settingsHandler);
|
static void askUserAboutMcuSupportKitsUpgrade(const SettingsHandler::Ptr &settingsHandler);
|
||||||
|
static void askUserAboutRemovingUninstalledTargetsKits();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // McuSupport::Internal
|
} // McuSupport::Internal
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
constexpr auto ghs_rh850_d1m1a_baremetal_json = R"(
|
constexpr auto ghs_rh850_d1m1a_baremetal_json = R"(
|
||||||
{
|
{
|
||||||
"qulVersion": "2.3.0",
|
"qulVersion": "2.4.0",
|
||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"platform": {
|
"platform": {
|
||||||
"id": "RH850-D1M1A-BAREMETAL",
|
"id": "RH850-D1M1A-BAREMETAL",
|
||||||
@@ -19,17 +19,16 @@ constexpr auto ghs_rh850_d1m1a_baremetal_json = R"(
|
|||||||
"setting": "FlashProgrammerPath",
|
"setting": "FlashProgrammerPath",
|
||||||
"label": "Renesas Flash Programmer",
|
"label": "Renesas Flash Programmer",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"setting": "RenesasFlashProgrammer",
|
|
||||||
"cmakeVar": "RENESAS_FLASH_PROGRAMMER_PATH",
|
"cmakeVar": "RENESAS_FLASH_PROGRAMMER_PATH",
|
||||||
"defaultValue": {
|
"defaultValue": {
|
||||||
"windows": "%{Env:PROGRAMFILES}/Renesas Electronics/Programming Tools/Renesas Flash Programmer V3.09",
|
"linux": "",
|
||||||
"linux": "%{Env:HOME}"
|
"windows": "%{Env:PROGRAMFILES(x86)}/Renesas Electronics/Programming Tools/Renesas Flash Programmer V3.09"
|
||||||
},
|
},
|
||||||
"detectionPath": {
|
"detectionPath": {
|
||||||
"windows": "rfp-cli.exe",
|
"windows": "rfp-cli.exe",
|
||||||
"linux": "rfp-cli"
|
"linux": "rfp-cli"
|
||||||
},
|
},
|
||||||
"envVar": "RENESAS_FLASH_PROGRAMMER_PATH",
|
"envVar": "RenesasFlashProgrammer_PATH",
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"addToSystemPath": true
|
"addToSystemPath": true
|
||||||
}
|
}
|
||||||
@@ -45,6 +44,10 @@ constexpr auto ghs_rh850_d1m1a_baremetal_json = R"(
|
|||||||
"setting": "GHSToolchain",
|
"setting": "GHSToolchain",
|
||||||
"label": "Green Hills Compiler",
|
"label": "Green Hills Compiler",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": {
|
||||||
|
"linux": "",
|
||||||
|
"windows": "C:/ghs/comp_201815"
|
||||||
|
},
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"filePattern": {
|
"filePattern": {
|
||||||
@@ -71,12 +74,16 @@ constexpr auto ghs_rh850_d1m1a_baremetal_json = R"(
|
|||||||
"envVar": "RGL_DIR",
|
"envVar": "RGL_DIR",
|
||||||
"setting": "RGL_DIR",
|
"setting": "RGL_DIR",
|
||||||
"versions": [
|
"versions": [
|
||||||
|
"2.0.0",
|
||||||
"2.0.0a"
|
"2.0.0a"
|
||||||
],
|
],
|
||||||
"label": "Renesas Graphics Library",
|
"label": "Renesas Graphics Library",
|
||||||
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"defaultValue": "/Renesas_Electronics/D1x_RGL/rgl_ghs_D1Mx_obj_V.2.0.0a",
|
"defaultValue": {
|
||||||
|
"linux": "",
|
||||||
|
"windows": "%{Env:PROGRAMFILES(x86)}/Renesas_Electronics/D1x_RGL/rgl_ghs_D1Mx_obj_V.2.0.0a"
|
||||||
|
},
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"regex": "\\d+\\.\\d+\\.\\w+"
|
"regex": "\\d+\\.\\d+\\.\\w+"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
constexpr auto ghs_tviic2d4m_baremetal_json = R"(
|
constexpr auto ghs_tviic2d4m_baremetal_json = R"(
|
||||||
{
|
{
|
||||||
"qulVersion": "2.3.0",
|
"qulVersion": "2.4.0",
|
||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"platform": {
|
"platform": {
|
||||||
"id": "TVIIC2D4M-BAREMETAL",
|
"id": "TVIIC2D4M-BAREMETAL",
|
||||||
@@ -16,9 +16,10 @@ constexpr auto ghs_tviic2d4m_baremetal_json = R"(
|
|||||||
"cmakeEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"setting": "CypressAutoFlashUtil",
|
"setting": "InfineonAutoFlashUtil",
|
||||||
"label": "Cypress Auto Flash Utility",
|
"label": "Infineon Auto Flash Utility",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/Infineon/Auto Flash Utility 1.2",
|
||||||
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"detectionPath": "bin/openocd.exe",
|
"detectionPath": "bin/openocd.exe",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
@@ -36,8 +37,8 @@ constexpr auto ghs_tviic2d4m_baremetal_json = R"(
|
|||||||
"label": "Green Hills Compiler for ARM",
|
"label": "Green Hills Compiler for ARM",
|
||||||
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
||||||
"setting": "GHSArmToolchain",
|
"setting": "GHSArmToolchain",
|
||||||
"detectionPath": "cxarm.exe",
|
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "C:/ghs/comp_201954",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"filePattern": "gversion.exe",
|
"filePattern": "gversion.exe",
|
||||||
@@ -59,15 +60,17 @@ constexpr auto ghs_tviic2d4m_baremetal_json = R"(
|
|||||||
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"versions": [
|
"versions": [
|
||||||
"V1e.1.0"
|
"V1.2.0"
|
||||||
],
|
],
|
||||||
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"label": "Graphics Driver for Traveo II Cluster Series",
|
"label": "Graphics Driver for Traveo II Cluster Series",
|
||||||
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "C:/TVII-GraphicsDriver",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"regex": "V\\w+\\.\\d+\\.\\d+"
|
"regex": "V\\d+\\.\\d+\\.\\d+"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
constexpr auto ghs_tviic2d6m_baremetal_json = R"(
|
constexpr auto ghs_tviic2d6m_baremetal_json = R"(
|
||||||
{
|
{
|
||||||
"qulVersion": "2.3.0",
|
"qulVersion": "2.4.0",
|
||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"platform": {
|
"platform": {
|
||||||
"id": "TVIIC2D6M-BAREMETAL",
|
"id": "TVIIC2D6M-BAREMETAL",
|
||||||
@@ -16,9 +16,10 @@ constexpr auto ghs_tviic2d6m_baremetal_json = R"(
|
|||||||
"cmakeEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"setting": "CypressAutoFlashUtil",
|
"setting": "InfineonAutoFlashUtil",
|
||||||
"label": "Cypress Auto Flash Utility",
|
"label": "Infineon Auto Flash Utility",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/Infineon/Auto Flash Utility 1.2",
|
||||||
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"detectionPath": "bin/openocd.exe",
|
"detectionPath": "bin/openocd.exe",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
@@ -36,8 +37,8 @@ constexpr auto ghs_tviic2d6m_baremetal_json = R"(
|
|||||||
"label": "Green Hills Compiler for ARM",
|
"label": "Green Hills Compiler for ARM",
|
||||||
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
||||||
"setting": "GHSArmToolchain",
|
"setting": "GHSArmToolchain",
|
||||||
"detectionPath": "cxarm.exe",
|
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "C:/ghs/comp_201954",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"filePattern": "gversion.exe",
|
"filePattern": "gversion.exe",
|
||||||
@@ -59,15 +60,17 @@ constexpr auto ghs_tviic2d6m_baremetal_json = R"(
|
|||||||
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"versions": [
|
"versions": [
|
||||||
"V1e.1.0"
|
"V2e.1.0"
|
||||||
],
|
],
|
||||||
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"label": "Graphics Driver for Traveo II Cluster Series",
|
"label": "Graphics Driver for Traveo II Cluster Series",
|
||||||
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "C:/TVII-GraphicsDriver",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"regex": "V\\w+\\.\\d+\\.\\d+"
|
"regex": "V\\d+e\\.\\d+\\.\\d+"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|||||||
77
src/plugins/mcusupport/test/iar_tviic2d4m_baremetal_json.h
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
// Copyright (C) 2022 The Qt Company Ltd.
|
||||||
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
||||||
|
{
|
||||||
|
"qulVersion": "2.4.0",
|
||||||
|
"compatVersion": "1",
|
||||||
|
"platform": {
|
||||||
|
"id": "TVIIC2D4M-BAREMETAL",
|
||||||
|
"vendor": "CYPRESS",
|
||||||
|
"colorDepths": [
|
||||||
|
32
|
||||||
|
],
|
||||||
|
"cmakeEntries": [
|
||||||
|
{
|
||||||
|
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
|
"setting": "InfineonAutoFlashUtil",
|
||||||
|
"label": "Infineon Auto Flash Utility",
|
||||||
|
"type": "path",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/Infineon/Auto Flash Utility 1.2",
|
||||||
|
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
|
"detectionPath": "bin/openocd.exe",
|
||||||
|
"optional": false,
|
||||||
|
"addToSystemPath": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"toolchain": {
|
||||||
|
"id": "iar",
|
||||||
|
"versions": [
|
||||||
|
"8.22.3"
|
||||||
|
],
|
||||||
|
"compiler": {
|
||||||
|
"id": "IARToolchain",
|
||||||
|
"setting": "IARToolchain",
|
||||||
|
"envVar": "IAR_ARM_COMPILER_DIR",
|
||||||
|
"label": "IAR ARM Compiler",
|
||||||
|
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
||||||
|
"type": "path",
|
||||||
|
"versionDetection": {
|
||||||
|
"filePattern": "bin/iccarm.exe",
|
||||||
|
"executableArgs": "--version",
|
||||||
|
"regex": "\\bV(\\d+\\.\\d+\\.\\d+)\\.\\d+\\b"
|
||||||
|
},
|
||||||
|
"detectionPath": "bin/iccarm.exe",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/IAR Systems/Embedded Workbench 8.0 EWARM FS 8.22.3/arm",
|
||||||
|
"optional": false
|
||||||
|
},
|
||||||
|
"file": {
|
||||||
|
"id": "IAR_CMAKE_TOOLCHAIN_FILE",
|
||||||
|
"cmakeVar": "CMAKE_TOOLCHAIN_FILE",
|
||||||
|
"type": "file",
|
||||||
|
"defaultValue": "%{Qul_ROOT}/lib/cmake/Qul/toolchain/iar.cmake",
|
||||||
|
"visible": false,
|
||||||
|
"optional": false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"boardSdk": {
|
||||||
|
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
|
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
|
"versions": [
|
||||||
|
"V1.2.0"
|
||||||
|
],
|
||||||
|
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
|
"label": "Graphics Driver for Traveo II Cluster Series",
|
||||||
|
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
||||||
|
"type": "path",
|
||||||
|
"defaultValue": "C:/TVII-GraphicsDriver",
|
||||||
|
"optional": false,
|
||||||
|
"versionDetection": {
|
||||||
|
"regex": "V\\d+\\.\\d+\\.\\d+"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)";
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
||||||
{
|
{
|
||||||
"qulVersion": "2.3.0",
|
"qulVersion": "2.4.0",
|
||||||
"compatVersion": "1",
|
"compatVersion": "1",
|
||||||
"platform": {
|
"platform": {
|
||||||
"id": "TVIIC2D6M-BAREMETAL",
|
"id": "TVIIC2D6M-BAREMETAL",
|
||||||
@@ -16,9 +16,10 @@ constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
|||||||
"cmakeEntries": [
|
"cmakeEntries": [
|
||||||
{
|
{
|
||||||
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"id": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"setting": "CypressAutoFlashUtil",
|
"setting": "InfineonAutoFlashUtil",
|
||||||
"label": "Cypress Auto Flash Utility",
|
"label": "Infineon Auto Flash Utility",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/Infineon/Auto Flash Utility 1.2",
|
||||||
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
"cmakeVar": "INFINEON_AUTO_FLASH_UTILITY_DIR",
|
||||||
"detectionPath": "bin/openocd.exe",
|
"detectionPath": "bin/openocd.exe",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
@@ -39,14 +40,12 @@ constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
|||||||
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
"cmakeVar": "QUL_TARGET_TOOLCHAIN_DIR",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"filePattern": {
|
"filePattern": "bin/iccarm.exe",
|
||||||
"windows": "bin/iccarm.exe",
|
|
||||||
"linux": "bin/iccarm"
|
|
||||||
},
|
|
||||||
"executableArgs": "--version",
|
"executableArgs": "--version",
|
||||||
"regex": "\\bV(\\d+\\.\\d+\\.\\d+)\\.\\d+\\b"
|
"regex": "\\bV(\\d+\\.\\d+\\.\\d+)\\.\\d+\\b"
|
||||||
},
|
},
|
||||||
"detectionPath": "bin/iccarm.exe",
|
"detectionPath": "bin/iccarm.exe",
|
||||||
|
"defaultValue": "%{Env:PROGRAMFILES(x86)}/IAR Systems/Embedded Workbench 8.0 EWARM FS 8.22.3/arm",
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
"file": {
|
"file": {
|
||||||
@@ -62,15 +61,17 @@ constexpr auto iar_tviic2d6m_baremetal_json = R"(
|
|||||||
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
"envVar": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
"setting": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"versions": [
|
"versions": [
|
||||||
"V1e.1.0"
|
"V2e.1.0"
|
||||||
],
|
],
|
||||||
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
"id": "TVII_GRAPHICS_DRIVER_DIR",
|
||||||
"label": "Graphics Driver for Traveo II Cluster Series",
|
"label": "Graphics Driver for Traveo II Cluster Series",
|
||||||
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
"cmakeVar": "QUL_BOARD_SDK_DIR",
|
||||||
"type": "path",
|
"type": "path",
|
||||||
|
"defaultValue": "C:/TVII-GraphicsDriver",
|
||||||
"optional": false,
|
"optional": false,
|
||||||
"versionDetection": {
|
"versionDetection": {
|
||||||
"regex": "V\\w+\\.\\d+\\.\\d+"
|
"regex": "V\\d+e\\.\\d+\\.\\d+"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
)";
|
)";
|
||||||
|
|||||||
@@ -284,6 +284,7 @@ void DeviceSettingsWidget::updateDeviceFromUi()
|
|||||||
|
|
||||||
void DeviceSettingsWidget::saveSettings()
|
void DeviceSettingsWidget::saveSettings()
|
||||||
{
|
{
|
||||||
|
updateDeviceFromUi();
|
||||||
ICore::settings()->setValueWithDefault(LastDeviceIndexKey, currentIndex(), 0);
|
ICore::settings()->setValueWithDefault(LastDeviceIndexKey, currentIndex(), 0);
|
||||||
DeviceManager::replaceInstance();
|
DeviceManager::replaceInstance();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,6 +265,7 @@ void GenericLinuxDeviceConfigurationWidget::updateDeviceFromUi()
|
|||||||
timeoutEditingFinished();
|
timeoutEditingFinished();
|
||||||
sourceProfileCheckingChanged(m_sourceProfileCheckBox->isChecked());
|
sourceProfileCheckingChanged(m_sourceProfileCheckBox->isChecked());
|
||||||
linkDeviceChanged(m_linkDeviceComboBox->currentIndex());
|
linkDeviceChanged(m_linkDeviceComboBox->currentIndex());
|
||||||
|
qmlRuntimeEditingFinished();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel()
|
void GenericLinuxDeviceConfigurationWidget::updatePortsWarningLabel()
|
||||||
|
|||||||
@@ -220,7 +220,9 @@ void SshSharedConnection::emitConnected()
|
|||||||
void SshSharedConnection::emitError(QProcess::ProcessError error, const QString &errorString)
|
void SshSharedConnection::emitError(QProcess::ProcessError error, const QString &errorString)
|
||||||
{
|
{
|
||||||
m_state = QProcess::NotRunning;
|
m_state = QProcess::NotRunning;
|
||||||
ProcessResultData resultData = m_masterProcess->resultData();
|
ProcessResultData resultData{-1, QProcess::CrashExit, QProcess::UnknownError, {}};
|
||||||
|
if (m_masterProcess)
|
||||||
|
resultData = m_masterProcess->resultData();
|
||||||
resultData.m_error = error;
|
resultData.m_error = error;
|
||||||
resultData.m_errorString = errorString;
|
resultData.m_errorString = errorString;
|
||||||
emit disconnected(resultData);
|
emit disconnected(resultData);
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ void updateEditorText(QPlainTextEdit *editor, const QString &text)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cursor.movePosition(QTextCursor::Right, QTextCursor::KeepAnchor, d.text.size());
|
cursor.setPosition(cursor.position() + d.text.size(), QTextCursor::KeepAnchor);
|
||||||
cursor.removeSelectedText();
|
cursor.removeSelectedText();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -223,7 +223,7 @@ void updateEditorText(QPlainTextEdit *editor, const QString &text)
|
|||||||
case Diff::Equal:
|
case Diff::Equal:
|
||||||
// Adjust cursor position
|
// Adjust cursor position
|
||||||
charactersInfrontOfCursor -= d.text.size();
|
charactersInfrontOfCursor -= d.text.size();
|
||||||
cursor.movePosition(QTextCursor::Right, QTextCursor::MoveAnchor, d.text.size());
|
cursor.setPosition(cursor.position() + d.text.size(), QTextCursor::MoveAnchor);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -329,3 +329,56 @@ void formatEditorAsync(TextEditorWidget *editor, const Command &command, int sta
|
|||||||
}
|
}
|
||||||
|
|
||||||
} // namespace TextEditor
|
} // namespace TextEditor
|
||||||
|
|
||||||
|
#ifdef WITH_TESTS
|
||||||
|
#include "texteditorplugin.h"
|
||||||
|
#include <QTest>
|
||||||
|
|
||||||
|
namespace TextEditor::Internal {
|
||||||
|
|
||||||
|
void TextEditorPlugin::testFormatting_data()
|
||||||
|
{
|
||||||
|
QTest::addColumn<QString>("code");
|
||||||
|
QTest::addColumn<QString>("result");
|
||||||
|
|
||||||
|
{
|
||||||
|
QString code {
|
||||||
|
"import QtQuick\n\n"
|
||||||
|
" Item {\n"
|
||||||
|
" property string cat: [\"👩🏽🚒d👩🏽🚒d👩🏽🚒\"]\n"
|
||||||
|
" property string dog: cat\n"
|
||||||
|
"}\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
QString result {
|
||||||
|
"import QtQuick\n\n"
|
||||||
|
"Item {\n"
|
||||||
|
" property string cat: [\"👩🏽🚒\"]\n"
|
||||||
|
" property string dog: cat\n"
|
||||||
|
"}\n"
|
||||||
|
};
|
||||||
|
|
||||||
|
QTest::newRow("unicodeCharacterInFormattedCode") << code << result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextEditorPlugin::testFormatting()
|
||||||
|
{
|
||||||
|
QFETCH(QString, code);
|
||||||
|
QFETCH(QString, result);
|
||||||
|
|
||||||
|
QScopedPointer<TextEditorWidget> editor(new TextEditorWidget);
|
||||||
|
QVERIFY(editor.get());
|
||||||
|
|
||||||
|
QSharedPointer<TextDocument> doc(new TextDocument);
|
||||||
|
doc->setPlainText(code);
|
||||||
|
editor->setTextDocument(doc);
|
||||||
|
|
||||||
|
TextEditor::updateEditorText(editor.get(), result);
|
||||||
|
|
||||||
|
QCOMPARE(editor->toPlainText(), result);
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace TextEditor::Internal
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ private slots:
|
|||||||
|
|
||||||
void testIndentationClean_data();
|
void testIndentationClean_data();
|
||||||
void testIndentationClean();
|
void testIndentationClean();
|
||||||
|
|
||||||
|
void testFormatting_data();
|
||||||
|
void testFormatting();
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ macro(qtc_auto_setup_conan)
|
|||||||
message(FATAL_ERROR "conan --version failed='${result_code}: ${conan_version_output}")
|
message(FATAL_ERROR "conan --version failed='${result_code}: ${conan_version_output}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
string(REGEX REPLACE ".*Conan version ([0-9].[0-9]).*" "\\1" conan_version "${conan_version_output}")
|
||||||
|
|
||||||
set(conanfile_timestamp_file "${CMAKE_BINARY_DIR}/conan-dependencies/conanfile.timestamp")
|
set(conanfile_timestamp_file "${CMAKE_BINARY_DIR}/conan-dependencies/conanfile.timestamp")
|
||||||
file(TIMESTAMP "${conanfile_txt}" conanfile_timestamp)
|
file(TIMESTAMP "${conanfile_txt}" conanfile_timestamp)
|
||||||
|
|
||||||
@@ -68,6 +70,9 @@ macro(qtc_auto_setup_conan)
|
|||||||
if (do_conan_installation)
|
if (do_conan_installation)
|
||||||
message(STATUS "Qt Creator: conan package manager auto-setup. "
|
message(STATUS "Qt Creator: conan package manager auto-setup. "
|
||||||
"Skip this step by setting QT_CREATOR_SKIP_CONAN_SETUP to ON.")
|
"Skip this step by setting QT_CREATOR_SKIP_CONAN_SETUP to ON.")
|
||||||
|
|
||||||
|
file(COPY "${conanfile_txt}" DESTINATION "${CMAKE_BINARY_DIR}/conan-dependencies/")
|
||||||
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake" "
|
file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake" "
|
||||||
set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")
|
set(CMAKE_C_COMPILER \"${CMAKE_C_COMPILER}\")
|
||||||
set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\")
|
set(CMAKE_CXX_COMPILER \"${CMAKE_CXX_COMPILER}\")
|
||||||
@@ -77,17 +82,39 @@ macro(qtc_auto_setup_conan)
|
|||||||
"include(\"${CMAKE_TOOLCHAIN_FILE}\")\n")
|
"include(\"${CMAKE_TOOLCHAIN_FILE}\")\n")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/CMakeLists.txt" "
|
file(WRITE "${CMAKE_BINARY_DIR}/conan-dependencies/CMakeLists.txt" "
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
project(conan-setup)
|
|
||||||
include(\"${CMAKE_CURRENT_LIST_DIR}/conan.cmake\")
|
unset(CMAKE_PROJECT_INCLUDE_BEFORE CACHE)
|
||||||
conan_cmake_run(
|
project(conan-setup)
|
||||||
CONANFILE \"${conanfile_txt}\"
|
|
||||||
INSTALL_FOLDER \"${CMAKE_BINARY_DIR}/conan-dependencies\"
|
if (${conan_version} VERSION_GREATER_EQUAL 2.0)
|
||||||
GENERATORS cmake_paths json
|
include(\"${CMAKE_CURRENT_LIST_DIR}/conan_support.cmake\")
|
||||||
BUILD ${QT_CREATOR_CONAN_BUILD_POLICY}
|
conan_profile_detect_default()
|
||||||
ENV CONAN_CMAKE_TOOLCHAIN_FILE=\"${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake\"
|
detect_host_profile(\"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\")
|
||||||
)")
|
|
||||||
|
conan_install(
|
||||||
|
-pr \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_host_profile\"
|
||||||
|
--build=${QT_CREATOR_CONAN_BUILD_POLICY}
|
||||||
|
-s build_type=${CMAKE_BUILD_TYPE}
|
||||||
|
-g CMakeDeps)
|
||||||
|
if (CONAN_INSTALL_SUCCESS)
|
||||||
|
file(WRITE \"${CMAKE_BINARY_DIR}/conan-dependencies/conan_paths.cmake\" \"
|
||||||
|
list(PREPEND CMAKE_PREFIX_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\")
|
||||||
|
list(PREPEND CMAKE_MODULE_PATH \\\"\${CONAN_GENERATORS_FOLDER}\\\")
|
||||||
|
\")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
include(\"${CMAKE_CURRENT_LIST_DIR}/conan.cmake\")
|
||||||
|
conan_cmake_run(
|
||||||
|
CONANFILE \"${conanfile_txt}\"
|
||||||
|
INSTALL_FOLDER \"${CMAKE_BINARY_DIR}/conan-dependencies\"
|
||||||
|
GENERATORS cmake_paths cmake_find_package json
|
||||||
|
BUILD ${QT_CREATOR_CONAN_BUILD_POLICY}
|
||||||
|
ENV CONAN_CMAKE_TOOLCHAIN_FILE=\"${CMAKE_BINARY_DIR}/conan-dependencies/toolchain.cmake\"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
")
|
||||||
|
|
||||||
execute_process(COMMAND ${CMAKE_COMMAND}
|
execute_process(COMMAND ${CMAKE_COMMAND}
|
||||||
-S "${CMAKE_BINARY_DIR}/conan-dependencies/"
|
-S "${CMAKE_BINARY_DIR}/conan-dependencies/"
|
||||||
|
|||||||
211
src/share/3rdparty/package-manager/conan_support.cmake
vendored
Normal file
@@ -0,0 +1,211 @@
|
|||||||
|
# https://github.com/conan-io/cmake-conan/blob/develop2/conan_support.cmake
|
||||||
|
# commit: 3e088cd3e1d9d69e04b5250d565c1b8b55b0400b
|
||||||
|
#
|
||||||
|
# The MIT License (MIT)
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 JFrog
|
||||||
|
#
|
||||||
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
# of this software and associated documentation files (the "Software"), to deal
|
||||||
|
# in the Software without restriction, including without limitation the rights
|
||||||
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
# copies of the Software, and to permit persons to whom the Software is
|
||||||
|
# furnished to do so, subject to the following conditions:
|
||||||
|
#
|
||||||
|
# The above copyright notice and this permission notice shall be included in all
|
||||||
|
# copies or substantial portions of the Software.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
# SOFTWARE.
|
||||||
|
|
||||||
|
function(detect_os OS)
|
||||||
|
# it could be cross compilation
|
||||||
|
message(STATUS "Conan-cmake: cmake_system_name=${CMAKE_SYSTEM_NAME}")
|
||||||
|
if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic")
|
||||||
|
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
|
||||||
|
set(${OS} Macos PARENT_SCOPE)
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
|
||||||
|
set(${OS} Neutrino PARENT_SCOPE)
|
||||||
|
else()
|
||||||
|
set(${OS} ${CMAKE_SYSTEM_NAME} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(detect_cxx_standard CXX_STANDARD)
|
||||||
|
set(${CXX_STANDARD} ${CMAKE_CXX_STANDARD} PARENT_SCOPE)
|
||||||
|
if (CMAKE_CXX_EXTENSIONS)
|
||||||
|
set(${CXX_STANDARD} "gnu${CMAKE_CXX_STANDARD}" PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(detect_compiler COMPILER COMPILER_VERSION)
|
||||||
|
if(DEFINED CMAKE_CXX_COMPILER_ID)
|
||||||
|
set(_COMPILER ${CMAKE_CXX_COMPILER_ID})
|
||||||
|
set(_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
else()
|
||||||
|
if(NOT DEFINED CMAKE_C_COMPILER_ID)
|
||||||
|
message(FATAL_ERROR "C or C++ compiler not defined")
|
||||||
|
endif()
|
||||||
|
set(_COMPILER ${CMAKE_C_COMPILER_ID})
|
||||||
|
set(_COMPILER_VERSION ${CMAKE_C_COMPILER_VERSION})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Conan-cmake: CMake compiler=${_COMPILER}")
|
||||||
|
message(STATUS "Conan-cmake: CMake cmpiler version=${_COMPILER_VERSION}")
|
||||||
|
|
||||||
|
if(_COMPILER MATCHES MSVC)
|
||||||
|
set(_COMPILER "msvc")
|
||||||
|
string(SUBSTRING ${MSVC_VERSION} 0 3 _COMPILER_VERSION)
|
||||||
|
elseif(_COMPILER MATCHES AppleClang)
|
||||||
|
set(_COMPILER "apple-clang")
|
||||||
|
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
list(GET VERSION_LIST 0 _COMPILER_VERSION)
|
||||||
|
elseif(_COMPILER MATCHES Clang)
|
||||||
|
set(_COMPILER "clang")
|
||||||
|
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
list(GET VERSION_LIST 0 _COMPILER_VERSION)
|
||||||
|
elseif(_COMPILER MATCHES GNU)
|
||||||
|
set(_COMPILER "gcc")
|
||||||
|
string(REPLACE "." ";" VERSION_LIST ${CMAKE_CXX_COMPILER_VERSION})
|
||||||
|
list(GET VERSION_LIST 0 _COMPILER_VERSION)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Conan-cmake: [settings] compiler=${_COMPILER}")
|
||||||
|
message(STATUS "Conan-cmake: [settings] compiler.version=${_COMPILER_VERSION}")
|
||||||
|
|
||||||
|
set(${COMPILER} ${_COMPILER} PARENT_SCOPE)
|
||||||
|
set(${COMPILER_VERSION} ${_COMPILER_VERSION} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(detect_build_type BUILD_TYPE)
|
||||||
|
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
# Only set when we know we are in a single-configuration generator
|
||||||
|
# Note: we may want to fail early if `CMAKE_BUILD_TYPE` is not defined
|
||||||
|
set(${BUILD_TYPE} ${CMAKE_BUILD_TYPE} PARENT_SCOPE)
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(detect_host_profile output_file)
|
||||||
|
detect_os(MYOS)
|
||||||
|
detect_compiler(MYCOMPILER MYCOMPILER_VERSION)
|
||||||
|
detect_cxx_standard(MYCXX_STANDARD)
|
||||||
|
detect_build_type(MYBUILD_TYPE)
|
||||||
|
|
||||||
|
set(PROFILE "")
|
||||||
|
string(APPEND PROFILE "include(default)\n")
|
||||||
|
string(APPEND PROFILE "[settings]\n")
|
||||||
|
if(MYOS)
|
||||||
|
string(APPEND PROFILE os=${MYOS} "\n")
|
||||||
|
endif()
|
||||||
|
if(MYCOMPILER)
|
||||||
|
string(APPEND PROFILE compiler=${MYCOMPILER} "\n")
|
||||||
|
endif()
|
||||||
|
if(MYCOMPILER_VERSION)
|
||||||
|
string(APPEND PROFILE compiler.version=${MYCOMPILER_VERSION} "\n")
|
||||||
|
endif()
|
||||||
|
if(MYCXX_STANDARD)
|
||||||
|
string(APPEND PROFILE compiler.cppstd=${MYCXX_STANDARD} "\n")
|
||||||
|
endif()
|
||||||
|
if(MYBUILD_TYPE)
|
||||||
|
string(APPEND PROFILE "build_type=${MYBUILD_TYPE}\n")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT DEFINED output_file)
|
||||||
|
set(_FN "${CMAKE_BINARY_DIR}/profile")
|
||||||
|
else()
|
||||||
|
set(_FN ${output_file})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
string(APPEND PROFILE "[conf]\n")
|
||||||
|
string(APPEND PROFILE "tools.cmake.cmaketoolchain:generator=${CMAKE_GENERATOR}\n")
|
||||||
|
|
||||||
|
message(STATUS "Conan-cmake: Creating profile ${_FN}")
|
||||||
|
file(WRITE ${_FN} ${PROFILE})
|
||||||
|
message(STATUS "Conan-cmake: Profile: \n${PROFILE}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(conan_profile_detect_default)
|
||||||
|
message(STATUS "Conan-cmake: Checking if a default profile exists")
|
||||||
|
execute_process(COMMAND conan profile path default
|
||||||
|
RESULT_VARIABLE return_code
|
||||||
|
OUTPUT_VARIABLE conan_stdout
|
||||||
|
ERROR_VARIABLE conan_stderr
|
||||||
|
ECHO_ERROR_VARIABLE # show the text output regardless
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
if(NOT ${return_code} EQUAL "0")
|
||||||
|
message(STATUS "Conan-cmake: The default profile doesn't exist, detecting it.")
|
||||||
|
execute_process(COMMAND conan profile detect
|
||||||
|
RESULT_VARIABLE return_code
|
||||||
|
OUTPUT_VARIABLE conan_stdout
|
||||||
|
ERROR_VARIABLE conan_stderr
|
||||||
|
ECHO_ERROR_VARIABLE # show the text output regardless
|
||||||
|
ECHO_OUTPUT_VARIABLE
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(conan_install)
|
||||||
|
cmake_parse_arguments(ARGS CONAN_ARGS ${ARGN})
|
||||||
|
set(CONAN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/conan)
|
||||||
|
# Invoke "conan install" with the provided arguments
|
||||||
|
set(CONAN_ARGS ${CONAN_ARGS} -of=${CONAN_OUTPUT_FOLDER})
|
||||||
|
message(STATUS "CMake-conan: conan install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN}")
|
||||||
|
execute_process(COMMAND conan install ${CMAKE_SOURCE_DIR} ${CONAN_ARGS} ${ARGN} --format=json
|
||||||
|
RESULT_VARIABLE return_code
|
||||||
|
OUTPUT_VARIABLE conan_stdout
|
||||||
|
ERROR_VARIABLE conan_stderr
|
||||||
|
ECHO_ERROR_VARIABLE # show the text output regardless
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
if(NOT "${return_code}" STREQUAL "0")
|
||||||
|
message(FATAL_ERROR "Conan install failed='${return_code}'")
|
||||||
|
else()
|
||||||
|
# the files are generated in a folder that depends on the layout used, if
|
||||||
|
# one if specified, but we don't know a priori where this is.
|
||||||
|
# TODO: this can be made more robust if Conan can provide this in the json output
|
||||||
|
string(JSON CONAN_GENERATORS_FOLDER GET ${conan_stdout} graph nodes 0 generators_folder)
|
||||||
|
# message("conan stdout: ${conan_stdout}")
|
||||||
|
message(STATUS "CMake-conan: CONAN_GENERATORS_FOLDER=${CONAN_GENERATORS_FOLDER}")
|
||||||
|
set(CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}" PARENT_SCOPE)
|
||||||
|
set(CONAN_INSTALL_SUCCESS TRUE CACHE BOOL "Conan install has been invoked and was successful")
|
||||||
|
endif()
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
|
||||||
|
function(conan_provide_dependency package_name)
|
||||||
|
if(NOT CONAN_INSTALL_SUCCESS)
|
||||||
|
message(STATUS "CMake-conan: first find_package() found. Installing dependencies with Conan")
|
||||||
|
conan_profile_detect_default()
|
||||||
|
detect_host_profile(${CMAKE_BINARY_DIR}/conan_host_profile)
|
||||||
|
if(NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
|
message(STATUS "CMake-conan: Installing single configuration ${CMAKE_BUILD_TYPE}")
|
||||||
|
conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile --build=missing -g CMakeDeps)
|
||||||
|
else()
|
||||||
|
message(STATUS "CMake-conan: Installing both Debug and Release")
|
||||||
|
conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile -s build_type=Release --build=missing -g CMakeDeps)
|
||||||
|
conan_install(-pr ${CMAKE_BINARY_DIR}/conan_host_profile -s build_type=Debug --build=missing -g CMakeDeps)
|
||||||
|
endif()
|
||||||
|
if (CONAN_INSTALL_SUCCESS)
|
||||||
|
set(CONAN_GENERATORS_FOLDER "${CONAN_GENERATORS_FOLDER}" CACHE PATH "Conan generators folder")
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
|
message(STATUS "CMake-conan: find_package(${package_name}) found, 'conan install' aready ran")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if (CONAN_GENERATORS_FOLDER)
|
||||||
|
list(PREPEND CMAKE_PREFIX_PATH "${CONAN_GENERATORS_FOLDER}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
find_package(${ARGN} BYPASS_PROVIDER)
|
||||||
|
endfunction()
|
||||||
@@ -354,7 +354,7 @@ private slots:
|
|||||||
QFETCH(CommandLine, cmdLine);
|
QFETCH(CommandLine, cmdLine);
|
||||||
|
|
||||||
TestShell shell(cmdLine, true);
|
TestShell shell(cmdLine, true);
|
||||||
QCOMPARE(shell.state(), DeviceShell::State::NoScript);
|
QCOMPARE(shell.state(), DeviceShell::State::Failed);
|
||||||
|
|
||||||
const RunResult result = shell.runInShell({"echo", {"Hello"}});
|
const RunResult result = shell.runInShell({"echo", {"Hello"}});
|
||||||
QCOMPARE(result.exitCode, 0);
|
QCOMPARE(result.exitCode, 0);
|
||||||
|
|||||||
@@ -1,4 +1,2 @@
|
|||||||
[requires]
|
[requires]
|
||||||
fmt/8.0.0
|
fmt/9.1.0
|
||||||
[generators]
|
|
||||||
cmake_find_package
|
|
||||||
|
|||||||
@@ -1,10 +1,37 @@
|
|||||||
# Copyright (C) 2016 The Qt Company Ltd.
|
# Copyright (C) 2016 The Qt Company Ltd.
|
||||||
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
||||||
|
|
||||||
|
def toggleIssuesFilter(filterName, checked):
|
||||||
|
try:
|
||||||
|
toggleFilter = waitForObject("{type='QToolButton' toolTip='Filter by categories' "
|
||||||
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
|
clickButton(toggleFilter)
|
||||||
|
filterMenu = waitForObject("{type='QMenu' unnamed='1' visible='1'}")
|
||||||
|
waitFor("filterMenu.visible", 1000)
|
||||||
|
|
||||||
|
filterCategory = waitForObjectItem(filterMenu, filterName)
|
||||||
|
waitFor("filterCategory.visible", 2000)
|
||||||
|
if filterCategory.checked == checked:
|
||||||
|
test.log("Filter '%s' has already check state %s - not toggling."
|
||||||
|
% (filterName, checked))
|
||||||
|
clickButton(toggleFilter) # close the menu again
|
||||||
|
else:
|
||||||
|
activateItem(filterCategory)
|
||||||
|
test.log("Filter '%s' check state changed to %s." % (filterName, checked))
|
||||||
|
except:
|
||||||
|
t,v = sys.exc_info()[:2]
|
||||||
|
test.log("Exception while toggling filter '%s'" % filterName,
|
||||||
|
"%s(%s)" % (str(t), str(v)))
|
||||||
|
|
||||||
def getBuildIssues():
|
def getBuildIssues():
|
||||||
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
|
ensureChecked(":Qt Creator_Issues_Core::Internal::OutputPaneToggleButton")
|
||||||
model = waitForObject(":Qt Creator.Issues_QListView").model()
|
model = waitForObject(":Qt Creator.Issues_QListView").model()
|
||||||
return dumpBuildIssues(model)
|
# filter out possible code model issues present inside the Issues pane
|
||||||
|
toggleIssuesFilter("Clang Code Model", False)
|
||||||
|
result = dumpBuildIssues(model)
|
||||||
|
# reset the filter
|
||||||
|
toggleIssuesFilter("Clang Code Model", True)
|
||||||
|
return result
|
||||||
|
|
||||||
# this method checks the last build (if there's one) and logs the number of errors, warnings and
|
# this method checks the last build (if there's one) and logs the number of errors, warnings and
|
||||||
# lines within the Issues output
|
# lines within the Issues output
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ def setBreakpointsForCurrentProject(filesAndLines):
|
|||||||
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
"window=':Qt Creator_Core::Internal::MainWindow'}")
|
||||||
breakPointList = []
|
breakPointList = []
|
||||||
for current in filesAndLines:
|
for current in filesAndLines:
|
||||||
for curFile,curLine in current.iteritems():
|
for curFile,curLine in current.items():
|
||||||
if not openDocument(curFile):
|
if not openDocument(curFile):
|
||||||
return None
|
return None
|
||||||
editor = getEditorForFileSuffix(curFile, True)
|
editor = getEditorForFileSuffix(curFile, True)
|
||||||
@@ -239,7 +239,7 @@ def __logDebugResult__():
|
|||||||
|
|
||||||
def verifyBreakPoint(bpToVerify):
|
def verifyBreakPoint(bpToVerify):
|
||||||
if isinstance(bpToVerify, dict):
|
if isinstance(bpToVerify, dict):
|
||||||
fileName = bpToVerify.keys()[0]
|
fileName = list(bpToVerify.keys())[0]
|
||||||
editor = getEditorForFileSuffix(fileName)
|
editor = getEditorForFileSuffix(fileName)
|
||||||
if editor:
|
if editor:
|
||||||
test.compare(waitForObject(":DebugModeWidget_QComboBox").toolTip, fileName,
|
test.compare(waitForObject(":DebugModeWidget_QComboBox").toolTip, fileName,
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ def __handleTextTips__(textTip, expectedVals, alternativeVals):
|
|||||||
if not expFail:
|
if not expFail:
|
||||||
test.passes("TextTip verified")
|
test.passes("TextTip verified")
|
||||||
else:
|
else:
|
||||||
for key,val in eResult.iteritems():
|
for key,val in eResult.items():
|
||||||
if val == False:
|
if val == False:
|
||||||
if aResult and aResult.get(key):
|
if aResult and aResult.get(key):
|
||||||
test.passes("Property '%s' does not match expected, but alternative value" % key)
|
test.passes("Property '%s' does not match expected, but alternative value" % key)
|
||||||
@@ -240,7 +240,7 @@ def verifyProperties(properties, expectedProps):
|
|||||||
test.warning("Wrong usage - both parameter must be of type dict")
|
test.warning("Wrong usage - both parameter must be of type dict")
|
||||||
return {}
|
return {}
|
||||||
result = {}
|
result = {}
|
||||||
for key,val in expectedProps.iteritems():
|
for key,val in expectedProps.items():
|
||||||
foundVal = properties.get(key, None)
|
foundVal = properties.get(key, None)
|
||||||
if foundVal != None:
|
if foundVal != None:
|
||||||
result[key] = val == foundVal
|
result[key] = val == foundVal
|
||||||
|
|||||||
@@ -342,7 +342,7 @@ def getConfiguredKits():
|
|||||||
# update collected Qt versions with their configured device and version
|
# update collected Qt versions with their configured device and version
|
||||||
iterateKits(False, True, __setQtVersionForKit__, kitsWithQtVersionName)
|
iterateKits(False, True, __setQtVersionForKit__, kitsWithQtVersionName)
|
||||||
# merge defined target names with their configured Qt versions and devices
|
# merge defined target names with their configured Qt versions and devices
|
||||||
for kit, qtVersion in kitsWithQtVersionName.iteritems():
|
for kit, qtVersion in kitsWithQtVersionName.items():
|
||||||
if qtVersion in qtVersionNames:
|
if qtVersion in qtVersionNames:
|
||||||
result.append(kit)
|
result.append(kit)
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -19,11 +19,14 @@ def clickItemVerifyHelpCombo(button, expectedHelpComboRegex, testDetails):
|
|||||||
"Verifying: '%s' button is being displayed." % getStarted)
|
"Verifying: '%s' button is being displayed." % getStarted)
|
||||||
def buttonActive(button):
|
def buttonActive(button):
|
||||||
# colors of the default theme for active button on Welcome page
|
# colors of the default theme for active button on Welcome page
|
||||||
(activeRed, activeGreen, activeBlue) = (69, 206, 85)
|
defaultActiveRGB = (69, 206, 85)
|
||||||
|
# colors of the dark theme for active button on Welcome page
|
||||||
|
darkActiveRGB = (54, 193, 72)
|
||||||
# QPalette::Window (used background color of Welcome page buttons)
|
# QPalette::Window (used background color of Welcome page buttons)
|
||||||
enumQPaletteWindow = 10
|
enumQPaletteWindow = 10
|
||||||
color = button.palette.color(enumQPaletteWindow)
|
color = button.palette.color(enumQPaletteWindow)
|
||||||
return color.red == activeRed and color.green == activeGreen and color.blue == activeBlue
|
current = (color.red, color.green, color.blue)
|
||||||
|
return current == defaultActiveRGB or current == darkActiveRGB
|
||||||
|
|
||||||
def waitForButtonsState(projectsActive, examplesActive, tutorialsActive, timeout=5000):
|
def waitForButtonsState(projectsActive, examplesActive, tutorialsActive, timeout=5000):
|
||||||
projButton = getWelcomeScreenSideBarButton('Projects')[0]
|
projButton = getWelcomeScreenSideBarButton('Projects')[0]
|
||||||
|
|||||||