Commit Graph

25 Commits

Author SHA1 Message Date
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
3844f59806 ProjectExplorer: Standardize RunWorker creation logic
This unifies the remaining paths of RunWorker creation to always
use RunWorkerFactories in the plugin pimpls.

There were, and are, still effectively three basic kinds of workers:
 - "toplevel" tools corresponding to the run modes, that are often all
    that's used for local runs and directly started via the fat buttons
    or e.g. entries in the analyze menu, with factories already previously
    located in the plugin pimpls
 -  core "tool helpers", providing tool specific functionality typically
    used in conjunction with a remote device specific run mechanism,
    set up via RunControl::registerWorkerCreator
 -  target/device specific runhelper like port gatherers contructed e.g.
    via *Device::workerCreator(Core::Id id)

Worse, these categories are partially overlapping, so it was not
clear how a "clean" setup would look like, instead some ad-hoc cobbling
"to make it work" happened.

In some cases, the runMode id was used throughout the whole ensemble
of run workers for a given run, and which worker exactly was created
depended on which of the mechanism above was used in which order.

With the new central setup, the top-level runmodes remain, but the
second kind gets new ids, so the implicit dependencies on order
of setup mechanism are avoided.

This also helps in the cases where there was previously unclarity of where
and how to set up worker factories: It's always and only the plugin
pimpl now.

Change-Id: Icd9a08e2d53e19abe8b21fe546f469fae353a69f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-27 07:54:45 +00:00
Eike Ziller
88b29792cb Merge remote-tracking branch 'origin/4.8' into 4.9
Conflicts:
	src/plugins/android/androidrunnerworker.cpp
	src/plugins/android/androidrunnerworker.h

Change-Id: I52b9117c8a57dc4a34cfc09d1ae9bc76e0752bfc
2019-02-04 15:21:55 +01:00
Vikas Pachdha
59de3fcb64 Android: Fix gdbserver upload for Windows when using Armv8 arch
The gdbserver is not uploaded to device for armv7 as lib symlink
is available and we can use the gdbserver packaged with the apk

Task-number: QTCREATORBUG-21317
Change-Id: I263eb48bbf3cf05b969db934a928185dba10373b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-02-01 08:17:56 +00:00
Eike Ziller
e5c2ee922a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/cpptools/compileroptionsbuilder.cpp

Change-Id: I743ea39480cc5c7b6febcd2e93713d15a3ae6d9c
2018-12-07 08:53:11 +01:00
BogDan Vatra
d51ddbb8f0 [Android] Fix qml debugging for Qt 5.12
Since Qt 5.12.0 we don't use qmljsdebugger extra intent param anymore
and we need to pass qmljsdebugger to the application arguments.

Fixes: QTBUG-72132
Change-Id: Icefb75e94027b145832c114fd90579bd10bcb898
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-12-03 12:39:29 +00:00
Orgad Shaneh
7096649fc2 Merge remote-tracking branch 'origin/4.8'
Change-Id: I5b18233936e3b2cd674df92a694ba73b5a3ed752
2018-12-03 09:56:07 +02:00
Vikas Pachdha
8c95ab7ac8 Android: Remove multiple code paths to run adb
Refactor the code to use adb from AndroidManager, do cleanup
and improve logging

Change-Id: I77b682d37c9328e6aa978eaf05b3b5c131907f09
Reviewed-by: hjk <hjk@qt.io>
2018-10-05 12:58:37 +00:00
Christian Stenger
3c965f3cb5 Android: Fix compile for gcc5.3
Change-Id: Ic061a4bc55e1924b82cc2ac1fd5c483654de90eb
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-05 06:36:05 +00:00
BogDan Vatra
25264d9bd9 Fix debugging on Android arm64/x86_64
On Android 64, there is no lib/ symlink anymore, so we need to upload
gdbserver from QtCreator.

Change-Id: Ib6f6d9b623dc61b72dd434ce1b3b409e880bdeaa
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-10-04 15:36:35 +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
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
099f8c7e80 Android: Remove AndroidRunnable::{beforeStart,afterFinish}AdbCommands
We have nowadays two ways to pass data from run configurations to
tool that do not require intimate knowledge of the sender:

1. Using RunConfigurationAspects, accessible for all workers in a
   RunControl
2. Using RunWorker::recordData for an individual worker.

This removes the need to use specific fields in a runnable and
means that a tool plugin can be better separated from target plugins.

The approaches are not mutually exclusive, both use an string-ish
id, I chose here to use the same string when using both.

This patch here uses approach 2. for the GammaRay/Android combo.
It also fixes a (harmless) typo (s/POSTSTART/POSTFINISH).

Change-Id: I4048693ca73b17253a39bfcacc9e1880ecf25736
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 10:18:27 +00:00
hjk
6585edf143 Android: Pass RunWorker to AndroidRunnerWorker
The RunWorker will carry the amPreStart/amPostFinish commands later,
and the run control is still accessible via worker->runControl().

Change-Id: Ieac1a1d2a5a8689025a7707b218df44ef2485b16
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 08:22:38 +00:00
hjk
cf01d20f95 Android: Remove AndroidRunnable::amStartExtraArgs
It was only set up in AndroidRunner from the run configuration
and passed to AndroidRunnerWorker, instead get in in the
AndroidRunnerWorker from the run configuration directly.

Change-Id: I52fc793f07ca766a80a1b06f216f850da0b563ed
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-16 08:22:06 +00:00
hjk
0031dbb667 Android: Remove AndroidRunnable::intentName
It was only uses to pass the intent from the Runner to the RunnerWorker,
use a normal stand-alone QString member and setter instead.

Change-Id: I0fde87b0177d4ed013f9599600929070362ea09c
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-15 10:36:48 +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
8e7c1bf1ab Android: Remove m_extraAppParams and m_extraEnvVars from Runnable
The idea was actually to make AndroidRunnable and "everything else",
i.e. StandardRunnable more similar over time to lessen the impact
of the "matrix" problem. The two removed items are avoidable.

Change-Id: I8ef011d76e2ad0154194ff5141ef8eb92cf235f3
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-05-09 09:27:37 +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
736f7f89d1 Android: Hide process deleter a bit
This also avoid a spurious(?) code model warning about
"function 'deleter' is not needed and will not be emitted"

Change-Id: I76372866ec1a51b3adc350d83b8efcd497b02cb5
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2018-05-08 12:52:49 +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
3309ed8783 Android: Add 'inline' to static function in header
Clang complains with a warning otherwise

Change-Id: Ia833529e4c37bb8c68d5445a04a7602481571a95
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
2018-04-18 11:11:22 +00: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