Commit Graph

101 Commits

Author SHA1 Message Date
hjk
7c28c4f744 Utils: Introduce a FilePath constructor from char arrays
Similar to QT_RESTRICTED_CAST_FROM_ASCII to avoid the need for
decorations in user code.

At the same time, drop some convenience constructors and functions
in CommandLine and Icon essentially serving the same purpose.

Change-Id: Ida4e5ac19c2da0a4298a97b2a8e1511d56bbb79d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-17 05:34:10 +00:00
hjk
52e5023bcc ProjectExplorer: Use Utils::CommandLine in ProjectExplorer::Runnable
Change-Id: Id965f1f9047dcbc3ea5c9ddaa550d12668cf8ae6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-13 15:04:30 +00:00
hjk
430e81facd All: Replace most SynchronousProcess by QtcProcess
Change-Id: I0bf22fef2cd4a7297ef5a1e9aa9c3e2b9348ba42
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-23 07:55:31 +00:00
Assam Boudjelthia
1372dfdf7f Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-01 08:11:56 +00:00
hjk
90ad902486 Utils: Remove CommandLine argument from QtcProcess::run{,Blocking}
Makes run() more similar to what start() looks like.

Also add some asserts to make sure run() and related functions are
only called on SyncronousProcesses, as these are currently the only
ones where this works.

Change-Id: Idee6076c3f40a484db5c17f5bb348698cc83d220
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-19 13:01:51 +00:00
hjk
55f768e1b0 Utils: Make process results accessible through QtcProcess object
The result is fully stored in the object anyway. Using the extra
SynchronousProcessResponse structure only causes copies of
the data and complicates access on the user side in
a lot of cases.

The result bits are now also accessible individually.

There's obvious room for follow-up changes on the topic, e.g.
ShellCommand::runCommand's parameter list could shrink to
just a SynchronousProcess parameter.

Change-Id: I45aa7eb23832340be06905929280c012e1217263
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-05-14 13:19:01 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
c23cdd9262 Utils: Merge {synchronous,qtc}process.{h,cpp} file pairs
Mechanical to prepare merging the actual classes.
Adapting #includes.

Change-Id: I77a2c28129287778bc870c30cb890cd26bc2e62b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-10 09:47:51 +00:00
hjk
5a9b715fed Android: Robustify aspect access by id
Warn, instead of crash in case the aspect implementation changes.

Change-Id: If74cb91395e317765d493a97dcd1cdecc6f94296
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-03-26 13:45:02 +00:00
Alessandro Portale
bc7d0561c3 Android: Simplify pre-/post-run adb command input
AdbCommandWidget is cumbersome to use and has issues regarding updating
the enabled state of the buttons and the dragging and dropping of items.

Cut the maintenance and replace AdbCommandWidget with a StringAspect,
where one line means one entry, just like several other places in Qt
Creator do.

Some residue remains though: in order to keep project settings
compatibility, we need to convert from QStringList (settings) to QString
(StringAspect) and back.

Change-Id: I3ebfff882358ba2e8c0ac6d5b309e89a84f0554c
Reviewed-by: hjk <hjk@qt.io>
2021-03-26 07:02:31 +00:00
Alessandro Portale
670616c6f9 Android: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I1242a5c62a27b7b8f30bb7b43ff406eceb4135f7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-23 10:51:37 +00:00
Assam Boudjelthia
b52ad29f3a Android: fix logcat not fetched when app exits/crash at start
Application output from logcat might not work if an app
crashes at the start, so with this patch we avoid that by
making logcat process fetch logs faster by not getting
the full logs but only the logs starting from the moment
we start the app (using -T arg).

This can be very annoying bug, because when starting the
app from QC it usually only prints "app_package_name died."
which forces the user to go into the logcat manually and
search for an error from thousands of lines.

Change-Id: Ic5ac0389cb28e7c80586490877a697272f3648af
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-11-24 07:51:26 +00:00
Assam Boudjelthia
e9c9440653 Android: allow passing apps arguments via manifest on non-debug mode
Uses 00a1e5da7e1aea373a7e6be1d51e1573ff167dd8.

Task-number: QTCREATORBUG-23712
Change-Id: I9a7e134420b608815589578f3851abf150674fd3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-09-11 10:00:32 +00:00
hjk
51e7bce109 ProjectExplorer: Rename Base*Aspect to *Aspect
In most cases they are used directly, so there's not much Base* in that.

Added the old name as alias as porting help for a while.

Change-Id: I494a8a560b8996bcf74915ea3570b504df6a6b4c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-08-14 07:35:43 +00:00
Eike Ziller
3944162039 Merge remote-tracking branch 'origin/4.13' into master
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/cmakeprojectmanager/cmakebuildstep.cpp
	src/plugins/cmakeprojectmanager/cmakebuildstep.h
	tests/auto/debugger/tst_namedemangler.cpp
	tests/auto/qml/codemodel/check/tst_check.cpp

Change-Id: Iefd5f71c03c0078513b76a92af764a4fb22ee4c2
2020-08-10 15:56:54 +02:00
Robert Loehning
fb17795a9f Android: Add missing full stop and fix message
sdk_definitions.json does not have to contain 'lldb;x.y' anymore
as this is part of the base installation nowadays.

Change-Id: I39bc988674a8e60b22cd852b890224ac1c87e8c8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-28 17:46:17 +00:00
Alessandro Portale
7b6d44a90a Android: Introduce constants for Android ABIs
Avoiding string duplication prevents typo-related runtime errors and
allows an IDE to use find symbol rather than plain text search.

Change-Id: I7fba7c7c5cf90c0b371efce3b575537b2708dd0f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-07-26 05:49:49 +00:00
hjk
43b658e9e7 Utils: Drop Utils::SkipEmptyParts again
We require Qt 5.14 nowadays.

Change-Id: Iff245257d3cb19207007c0445ee13814e66152dd
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-07-21 12:42:27 +00:00
Assam Boudjelthia
5bb462e070 Android: fix app logcat not always displayed
Fixes: QTCREATORBUG-23919
Fixes: QTCREATORBUG-23177
Task-number: QTCREATORBUG-23291
Change-Id: Ib053a15f2fd8e491a581268f3630725593186a47
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-07-10 13:05:30 +00:00
Assam Boudjelthia
59aa4f8033 Android: check forward port exist before removing it
Task-number: QTCREATORBUG-24155
Change-Id: I3675a63d5aa85b8d11be9021d1a79fac1390b26e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-08 09:32:18 +00:00
Assam Boudjelthia
41c697a67b Android: silence adb irrelevant SynchronousProcess error outputs
Task-number: QTCREATORBUG-24155
Change-Id: Ibebc48d471ef7aeec37c99eda5c27d5419c913f3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-08 07:08:13 +00:00
hjk
e1c88116b3 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
(cherry picked from commit 430a33dcd9)
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-07-06 11:15:18 +00:00
Assam Boudjelthia
f936e7c10d Android: rephrase few logs
Change-Id: If03a15c88caab210fd07c61312757317ea86af2f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-07-01 20:10:16 +00:00
hjk
1c81a3b3e8 All: Use Utils::SkipEmptyParts
Task-number: QTCREATORBUG-24098
Change-Id: Iab45de9a9c17ddc39a0e343b1175d4f6cb94b098
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-17 05:55:25 +00:00
hjk
e115e9b970 Android: Properly split am start extra parameter
Avoids, amongst others, adding an empty item if none is given.

Change-Id: Ieb823e2275ca803088a19a16d7f4238422b149c4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-06-12 09:07:13 +00:00
hjk
26121da90c Android: Use QRegularExpression for parsing logcat output
Task-number: QTCREATORBUG-24098
Change-Id: I3df81c06611f1547b9424e31ea1b4a4541573946
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-06-10 15:36:15 +00:00
hjk
ad379227a9 Android: Don't use --server argument to lldb-server
We are not re-using the server process currently, and servers surviving
their processes seems to lead to zombie server processes (on app
uninstall(?))

Change-Id: I996fcd490e98a5101840cbbab5f640abf1f2d90b
Reviewed-by: Dominik Holland <dominik.holland@qt.io>
2020-05-26 13:12:23 +00:00
hjk
5ce3059464 Android: Shuffle debug server detection code a bit
More in one place now.

Change-Id: I974c9351246ea88d8d16bcf7fb45abf763b7b7e5
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-19 13:24:23 +00:00
hjk
08734e2ea0 Android: Simplify debug server upload
Change-Id: Ib5fad98e71c29e3b28c9ba206fe20a38a75a471e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-19 13:17:49 +00:00
hjk
f3038bce08 Android: Search LLDB in new SDK location
Amends 3e79c7da48.

Change-Id: I6db991bc4d82000e0bb9860d85676bf1fdfb09a6
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-19 13:04:38 +00:00
hjk
8d3fd8d0de Android: Also try to kill lldb-server before starting
... and report upload errors.

Change-Id: I87b978290a1a6c74b63195d0e1724b1da6342b38
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-05-19 12:51:32 +00:00
hjk
4fb8bb9f06 Android: Consolidate error handling for not found debug servers
Change-Id: I55d0ef38cf250536e71b6828e762f51221162830
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-19 12:51:11 +00:00
hjk
d54c61b4bd Android: Simplify gdbserver upload logic a bit
Change-Id: I3b1950633ef99f1ead01edc864add8bb7f8a2031
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-19 10:41:58 +00:00
hjk
3d04efa0c8 Android: Determine debugger type from Kit settings
Change-Id: I7e83fa1df923fd2449eecfac9c9d82bae249e6c1
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-05-12 09:42:17 +00:00
hjk
4486f78e49 Android: Check existence of debug server binary before upload
Debugging will fail later, better catch the problem early.

Change-Id: I973ff346db718e2050f5aafab068717d4e723fa6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-04-29 13:31:08 +00:00
hjk
7d3c6f7c02 Android: Start lldb-server and attach
Change-Id: Id7c45d9161d3389e9de419835c312d87916a34bc
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-04-22 08:12:48 +00:00
hjk
d7b1adae78 Android: Setup lldb-server path in AndroidRunner
Currently unused, guarded by an always-false m_useLldb flag.

Change-Id: Icedfa4bace3d5160cdc3d4fbcf72a22d74d0aa0f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-04-16 04:54:22 +00:00
hjk
3a1dc3c3ed Android: Move gdbserver path determination to androidrunnerworker.cpp
That's the only user, and it's easier to extend to handle LLDB there.

Change-Id: I7ce236e2ff509b419d52b10d086a75ff0c2ea14b
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2020-04-15 07:14:34 +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
Assam Boudjelthia
67df868f5c Android: Automatically use the correct NDK for each Qt version
Based on change 286266, we can find a correct NDK version for Qt for
Andriod version. This change allows Android plugin to get relevant NDK
information and registers appropriate toolchains and kits settings.

[ChangeLog][Android] Automatically use correct NDK version
corresponding to used Qt version.

Task-number: QTCREATORBUG-23583
Change-Id: Ic6b0d7a1ae8962c075b77498de88e018a008ac3e
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-17 16:14:50 +00:00
Alessandro Portale
9904464074 Make various Q_LOGGING_CATEGORY's static
Change-Id: I43d3a198b0863d85a7fb305c7cb768f68acbd139
Reviewed-by: hjk <hjk@qt.io>
2020-01-15 14:54:10 +00:00
Eike Ziller
267946d100 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/boot2qt/qdbrunconfiguration.cpp
	src/plugins/boot2qt/qdbrunconfiguration.h
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
	src/plugins/qnx/qnxrunconfiguration.cpp
	src/plugins/remotelinux/remotelinuxrunconfiguration.h

Change-Id: I17c8e1bf300bb75d7317ccf7749dd3cc07709c21
2019-12-16 16:19:44 +01:00
Alessandro Portale
79bbe93c1b Android: Make more logged command calls copy&pasteable
Change-Id: I43e01efc4cb583235ad2d97150d4478b23558659
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-09 10:23:16 +00:00
Orgad Shaneh
49f6b0146a Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/mcusupport/mcusupportrunconfiguration.cpp
	src/plugins/python/pythonproject.cpp
	src/plugins/qmakeprojectmanager/qmakestep.cpp
	src/plugins/qmlprojectmanager/qmlproject.cpp
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I22507be28fd80c49c9fee0dff5937a40db176a82
2019-12-07 18:39:54 +02:00
BogDan Vatra
e21fe24c40 Android: Get the preferred Abi from apk & device
Change-Id: I47325aaec0575dde0e9c9669e61248dac753c670
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-11-29 09:30:58 +00:00
Eike Ziller
4e6142c932 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/autotest/testresultspane.cpp
	src/plugins/cmakeprojectmanager/cmaketool.cpp

Change-Id: Iade695ac9cab8bf3e3a1abd6e2c71f4a19132ac0
2019-11-21 22:18:35 +02:00
Alessandro Portale
cd4fe07708 Android: Use numerical options for remote chmod call in uploadGdbServer
androiddeplyqt does not deploy gdbserver anymore, since Qt 5.14.
Therefore the gdbverver deployment of Qt Creator is triggered for all
devices, some of which do not support the symbolic chmod parameters
(e.g. +x).

Change-Id: I66e9fabeb0da4a1a3693c655a085d81c15f9d263
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-11-20 16:34:11 +00:00
Cristian Adam
b6ab85a440 Android: Fix debugging on Windows
The pid script was wrongly quoted on Windows resulting in not having
logcat ability, and no debugging.

Change-Id: Ica40d033b61b69bb2372f54f0eba19ae1d2e3c9f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-11-20 11:00:15 +00:00
Alessandro Portale
9c43466485 Use HostOsInfo::withExecutableSuffix instead of if/else
Let's use our Utils.

Change-Id: I8cfbce55d2b41e42e86d050433df2cfd20cebe1b
Reviewed-by: hjk <hjk@qt.io>
2019-11-14 15:17:34 +00:00
BogDan Vatra
6b31f9cf23 Android multi arch support
[ChangeLog][Android] Android multi arch support for qmake

Change-Id: Ib8b1874604a3392130c96fbc00b26713b3d788ae
Reviewed-by: hjk <hjk@qt.io>
2019-09-16 07:34:54 +00:00