Commit Graph

79 Commits

Author SHA1 Message Date
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Jarek Kobus
c13d828c99 Remove unneeded includes of QProcess
Change-Id: I017e020c8b2a53d6f4a2422a0a0856044e768247
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-03 08:13:18 +00:00
Jarek Kobus
d74edd2806 Remove unused includes of mutex classes
Change-Id: I5a34cda0b27786cb37e642479b11fbd24b8b5c36
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-18 07:02:07 +00:00
Jarek Kobus
2b414508b7 Remove unneeded includes
Change-Id: I67fee9303509b7080e123a2a5826e200ce498ce2
Reviewed-by: hjk <hjk@qt.io>
2020-11-12 12:14:11 +00:00
hjk
6d66733d50 Android: Rename some gdbServer* to debugServer*
There's LLDB coming into play, and debugServer is what we use on
BareMetal and RemoteLinux, too.

Change-Id: I77f8545ebbe6685708215ac579789f7d4990b7be
Task-number: QTCREATORBUG-23260
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-04-15 07:14:04 +00:00
BogDan Vatra
23de4630fc Android: Fix pid type
PIDs on Android (also on linux) are int64 not int

Change-Id: I6611361d4f7ab66018b3174e8fe64a41fa111350
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 14:01:24 +00:00
hjk
164ae1428e ProjectExplorer: Move RunControl related classes to separate file pair
Change-Id: I5da56f80336673d595907abcc797f628be680cd5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-13 14:44:46 +00:00
Vikas Pachdha
d55373cab2 Android: Enable setting environment variables for android apps
Change-Id: Id4625f081d6997dcabad9b01fb09d6c9c6ef7477
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-08-02 10:01:12 +00:00
Vikas Pachdha
1b12da2493 Android: Support commandline arguments for Android app
Change-Id: I3910b68ebbf00e1b62da663a3e58224413a1929e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: hjk <hjk@qt.io>
2018-08-02 10:00:57 +00:00
Ulf Hermann
dab2045099 Android: Make sure we can queue AndroidDeviceInfo in connections
Change-Id: I7f59cba50e180ea4584442f8c2a409abb9e49a33
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-22 07:33:15 +00:00
hjk
2dccf95e49 Android: Remove AndroidRunnable
Not used anymore.

Change-Id: Iad4fd894c389b310d11cac2fe49b96ded39b0677
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 11:28:56 +00:00
hjk
130b08925d Android: Use packageName directly in AndroidRunnerWorker
That was the only remaining field of the AndroidRunnable, passing
the packageName as single string is sufficient.

Change-Id: I73333e58a0719df09d6905eb212007ce421f600e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-16 10:34:01 +00:00
hjk
52e0b47c3f Android: Flatten then AndroidRunnerWorker hierarchy again
The difference was the selection of findProcessPID vs
findProcessPIDPreNougat functions, done by a flag now
passed to and used inside a combined findProcessPID function.

Change-Id: I738cdac1a81302c2207f9bc3c74c7cf916ca4089
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-11 08:44:38 +00:00
hjk
ba01d8729e Android: Remove m_deviceSerialNumber and m_apiLevel from Runnable
It's nothing that can be chosen freely, rather a feature of
the current setup/device.

Change-Id: I39460e22dab56adcce9da44f61a895923fb8c2a0
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 08:54:09 +00:00
hjk
c4e3cda26a Android: Remove traces of special debugger setup
Change-Id: Ibf85a6e6e7c025287dd388bc5908cefc30fbaa2f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-08 09:56:09 +00:00
Eike Ziller
185fe0c705 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/android/androidrunnable.h
	src/plugins/android/androidrunner.cpp
	src/plugins/qmakeandroidsupport/qmakeandroidrunconfiguration.cpp
	src/plugins/qmakeprojectmanager/qmakeproject.cpp
	src/plugins/qmlprofiler/qmlprofilerruncontrol.cpp

Change-Id: I68093d44cfd672347eab82459ff70c21a32297ce
2018-04-17 10:09:35 +02:00
BogDan Vatra
429c596395 Android: Fix debugging on Android 8+
The new way is much reliable and now we can debug all the libs from very
first start, including static constructors, JNI_OnLoad, etc.

The downside is that the startup is a little bit slower then before.
On a Ryzen 1700X is 2 to 5 seconds slower.

Task-number: QTCREATORBUG-19081
Change-Id: Iacedf7b8aa84de5026f9c81eeca35dd377cf4640
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 14:05:40 +00:00
Ulf Hermann
6a964d8d0b Android: Support the extraenvvars and extraappparams options
The Qt/Android runtime does support passing parameters to the
application. We have to pass '-e extraappparams <base64 string>' and
'-e extraenvvars <base64 strings, concatenated by ";">'. This is very
handy and should actually be exposed in the GUI.

Change-Id: I8c84a53ab8f6f07ea5b6e01c902f53385df8b35f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-02-14 12:31:45 +00:00
hjk
c128731ff2 Debugger: Use a QUrl for Qml server port and host
Host and port reasonably belong together, using a QUrl makes that more
explicit and follows the lead of the Qml profiler in that area.

Change-Id: I754cb17d165ce6b2f25c655eeebfd8ac8f5a93c7
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-08-23 09:13:40 +00:00
Vikas Pachdha
cdffb378fd Android: Fix QML debugging
Specify the qml server address and use correct default loop back
address in qmlengine

Change-Id: I9b77cb3385041bbe79900e7f7a188ca26124bacc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-08-15 14:40:25 +00:00
Vikas Pachdha
a6a13bfb76 Android: Let user specify shell commands
Let user specify list of shell commands to run before app starts
and after app quits.

Change-Id: I9794fb96180530ca6c28ce6581fda51a25be28d4
Reviewed-by: hjk <hjk@qt.io>
2017-06-30 11:56:50 +00:00
hjk
ef7c633de2 Android: Re-enable QmlProfiler
Change-Id: Icd73475be421e6813b0d496020461e7020b547dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-29 14:00:22 +00:00
Vikas Pachdha
a30a18177b Android: Make Android manager activity start arguments configurable
Change-Id: I2e09029e4eb0b8a57fda53efff3d42f109bfe905
Reviewed-by: hjk <hjk@qt.io>
2017-06-28 09:09:32 +00:00
hjk
1d921ae044 Android: Convert into a RunWorker based setup
This moves all of the RunControl implementation into a single
RunWorker, not yet splitting it up into separate RunWorkers
which is the final goal of this series.

Change-Id: I7373105603505aa4fffd7fe5ff0145f0128b34bc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-06-12 06:38:40 +00:00
Eike Ziller
105b69836c Merge remote-tracking branch 'origin/4.3'
Conflicts:
	tests/auto/debugger/tst_dumpers.cpp

Change-Id: Id8b53b000f94a1b5ab923db79f67bad3276d09dc
2017-05-04 10:03:50 +02:00
Ulf Hermann
47b4a0811f Revert "Android: Improve application output window by adding filters"
This reverts commit d4ca232d54 and fixes
QML profiling on android.

Task-number: QTCREATORBUG-18120
Change-Id: I09b9062da197a4c6c0a7034f98a2bb0b41f1d559
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-04-28 14:43:47 +00:00
Eike Ziller
88897f3a87 Merge remote-tracking branch 'origin/4.3'
Conflicts:
	src/plugins/genericprojectmanager/genericproject.cpp
	src/plugins/genericprojectmanager/genericproject.h
	src/plugins/genericprojectmanager/genericprojectnodes.cpp
	src/plugins/genericprojectmanager/genericprojectnodes.h

Change-Id: Ie0c870f68c8d200a75489b75860987655b2f6175
2017-04-19 09:56:14 +02:00
BogDan Vatra
d4ca232d54 Android: Improve application output window by adding filters
- allow the user to choose the visible log levels
 - allow the user to choose which activities/service(s) logs are visible
 - wakeup the device (API 20+)
 - use only the most recent logs (API 21+ add "-T 0" to logcat params)
 - use logcat -v time format, which is the same on all Android versions

In the future we can even allow the user to choose which parts of the
log line are visible, e.g. time, log level, TAG, PID, Message

Task-number: QTCREATORBUG-16887
Change-Id: I07ce00aff59a479660f5ac6da75eef973ba3f627
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2017-04-12 13:57:34 +00:00
hjk
eee51e8c1d Android: Adapt to ProjectExplorer::ToolRunner introduction
Change-Id: I71cc25ef3daa0eee51a4c94285174e0f3b45d41f
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-03-30 10:11:02 +00:00
Ulf Hermann
5f950a80cc Android: Run all of AndroidRunner in a separate thread
This removes the need for blocking queued connections and runAsync(),
reducing the risk of deadlocks and eliminating unguarded concurrent
access to various members of AndroidRunner. No mutex locking is
necessary anymore as all communication between the two threads is
either done on initialization, before the worker thread starts, or
via queued signals.

Change-Id: Icc2fcc2c0ce73d1c226bc4740413e57490d1cbc6
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-08-18 09:32:34 +00:00
Ulf Hermann
100b3da662 Android: Make AndroidRunner a plain QObject
We're not using it as QThread.

Change-Id: Ib277325179a46fe7d153ff9d37043f54d0d41037
Reviewed-by: Vikas Pachdha <vikas.pachdha@theqtcompany.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-08-08 08:06:55 +00:00
Orgad Shaneh
1853f01a5b Merge remote-tracking branch 'origin/4.1'
Change-Id: Ia442f30f387fe9292217582260bbe79e54608810
2016-08-05 11:40:07 +02:00
Ulf Hermann
6c2036d900 Android: Run stop() asynchronously
Running SynchronousProcess (for adb) on the GUI thread is dangerous as
it might process unrelated events without returning, breaking
assumptions in other parts of Qt Creator. Rather run those things on a
worker thread, with a separate event loop, like we already do it when
starting processes.

Furthermore, returning, from start() or stop() while a thread is
running that accesses internals of AndroidRunner is also dangerous,
because most methods of AndroidRunner are not protected by relevant
mutexes and especially the destructor might get invoked while the
worker thread is still runnig. Thus, wait for the worker threads to
finish, in start() and stop().

This is a crutch, of course, as with proper locking we could keep the
GUI thread responsive while the adb commands are running, but just
serializing the execution reduces the risk of further breakage for now.

Change-Id: Ife92dc19aa8111374413590c3156027ba759746f
Task-number: QTCREATORBUG-16667
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-08-01 08:09:26 +00:00
Ulf Hermann
cbd738ab90 Android: Don't use blocking queued connections for running ps
If ps is run from a different thread than the GUI thread, then we are
obviously not dealing with the "checkPID" function that's running every
second. We don't need to be overly prudent about starting another
process then. On the other hand, the blocking queued connection relies
on the ps shell not getting closed from a different thread in between
and it is generally a risk for creating dead locks.

Change-Id: Ief49fb18cc3199dc345c4d9ca0ee24b66d33343c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-08-01 08:09:21 +00:00
Vikas Pachdha
148d7636f1 Starting AVD in run step. Before this change AVD was started only in deploy step.
Task-number: QTCREATORBUG-10237
Change-Id: Ic99cc84013e53ddc60ed05c7983e141ecfc75169
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-07-13 09:50:45 +00:00
Orgad Shaneh
88dfa84fc6 Android: Use Qt5-style connects
The heavy lifting was done by clazy.

Change-Id: Id09b62b7b9812d9c0981202c257d18387a8b09d9
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2016-07-04 09:35:58 +00:00
BogDan Vatra
19b513c7a2 Android: Initialize m_handShakeMethod
Change-Id: I016c98669c7a361e0d4a6c0da0cba8e3b8feccf6
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-06-10 10:19:42 +00:00
Tobias Hunger
ddefe062c7 Fix up QProcess::waitForFinished()
waitForFinish returns false if the process is no longer running at
the time of the call. Handle that throughout the codebase.

Change-Id: Ia7194095454e82efbd4eb88f2d55926bdd09e094
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-05-11 10:04:38 +00:00
Eike Ziller
0f94aa3f4d Merge remote-tracking branch 'origin/4.0'
Conflicts:
	src/plugins/debugger/debuggerruncontrol.cpp
	src/plugins/projectexplorer/projectwizardpage.cpp
	src/plugins/projectexplorer/xcodebuildparser.h
	src/plugins/qmldesigner/qmldesignerplugin.cpp
	src/tools/clangbackend/ipcsource/translationunits.cpp

Change-Id: Ibf0857cf8dbf95fc9ac13d5c2112b3f4a2ca7de6
2016-05-03 11:49:01 +02:00
BogDan Vatra
e26bbc8459 Fix warnings
Don't try to write from another thread into a process stdin. Fixes
"QSocketNotifier: Socket notifiers cannot be enabled or disabled from
another thread" warnings.

Change-Id: Id93a40a6bee6d4042cf600c8fabb06bf965d8ccc
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-29 13:35:40 +00:00
Ulf Hermann
385237dbbd Use Utils::Port where possible
This solves the ambiguity between 0 and -1 being the "invalid" port.

Change-Id: I3bac11dd4117bb1820fbd58186699925b73df1c5
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-04-20 11:06:34 +00:00
hjk
39a38d5679 Wholesale conversion to #pragma once
Kudos to cgmb and https://github.com/cgmb/guardonce

Change-Id: Ifa8970734b8d43fd08c9260c645bdb0228633791
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-30 15:20:19 +00:00
BogDan Vatra
bf3ba0f577 Don't create a QProcess object every second.
Creating a QProcess every second is very VERY expensive, making the QtCreator UI
experience pretty bad, the UI was not responsive when debugging or even when
running an Android application from QtCreator.

Thanks to Intel's VTUNE I could spot and fix the problem in minutes.

Change-Id: I6d3dc71db93e91d9846101a1877bab017df41aba
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-03-10 11:22:14 +00:00
BogDan Vatra
221b03a162 Add AndroidRunnable
Using the AndroidRunnable is easy for other plugins to run custom adb
commands before intent is started and after it's stopped.

Change-Id: I012ae87c92cea16aa8074dce2dc6f2b0c4ebeb30
Reviewed-by: hjk <hjk@theqtcompany.com>
2016-01-29 12:29:07 +00:00
Tobias Hunger
397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Martin Kampas
b10b39a6dc Android: Remove dead code related to local libs
The start point is the if (m_useLocalQtLibs) block in AndroidRunner
constructor which seems to be effectless since 8d27ec6 (Android: Fix
debugging applications that link many modules)

Change-Id: I7850c1f53a003553ae1b3fdf0881f4c9fedf7b15
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2015-12-03 18:35:47 +00:00
Eike Ziller
0ba4781bfc Merge remote-tracking branch 'origin/3.5'
Change-Id: I889b93611d1762121548fb71d1d3493e4adba313
2015-09-25 10:35:42 +02:00
hjk
b6e52b0c37 Android: Fix debugger startup with recent Android SDK
Android SDK Tools 24.x ship an adb that requires in the 'adb shell'
command an additional level of quotes for parameters with spaces
compared to previous versions. That broke the passing of the
gdbserver start command and consequently debugger startup.

Task-number: QTCREATORBUG-15032
Change-Id: I442355821641d4c6a632b50d1065c442736711aa
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
2015-09-23 14:53:22 +00:00
Ulf Hermann
5f90990c30 Tell the QML debug server exactly what services we expect
The services need to be loaded before the first QML engine is created.
The first QML engine may be created before a client connects. When the
JavaScript debug service is loaded the engine is put into interpreter
mode as we don't support debugging in JIT mode. Profiling, however
should be done in JIT mode, whenever possible.

Thus, in order to avoid the loading of unnecessary plugins and to get
better results from the QML profiler we tell the debug server which
services we expect, even before the client connects. Qt 5.6 will support
additional command line arguments to specify the services and this
change uses them.

Change-Id: I6dcee016c39995e9adada6eaf0e39d8299c9b7e7
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-08-17 15:13:56 +00:00