Commit Graph

258 Commits

Author SHA1 Message Date
hjk
dca7edbeef Let PortsGatherer produce full URLs instead of ports only
This is what the consuming code expects in most cases.

Change-Id: I135592039e28b994996186f627215ab1d2f8d6dc
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-08-26 08:16:03 +00:00
Christian Kandeler
6d3f236aab Utils::Environment: Use expanded values
The Environment class is supposed to support values with references to
other variables, but we failed to actually expand them in most places.

Fixes: QTCREATORBUG-22687
Change-Id: I108cb59d3b4571471423455240f6f4f1cf64bf05
Reviewed-by: hjk <hjk@qt.io>
2019-08-20 12:39:16 +00:00
hjk
8b72e92167 Utils: Add CommandLine convenience constructors
... taking a QString for the executable.

This weakens the very explicit QString -> FileName conversion via the
named constructors for the special case of constructing a CommandLine.

I think that's worthwhile here, as it reduces the noise on the caller
site under circumstance where the nature of the thing is obvious.

Change-Id: I27b4a73639728893d053b2e7ba65cb745f0ffe83
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-23 15:51:45 +00:00
hjk
5efa84b91f Replace remaining Utils::FileName occurrences by Utils::FilePath
Change-Id: Ic3120f18b4fbe90219de9128dba53d7453630b03
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 13:40:22 +00:00
hjk
1396c6e8e9 ProjectExplorer: Use Utils::FileName for Runnable::executable
Change-Id: I584bc18aa19a4c9886af7b13e95052dfd4350b34
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-21 10:32:31 +00:00
hjk
f636f06b45 Debugger: Remove GdbServerPortsGatherer::setDevice
Apparently not used anymore.

Change-Id: Ic9ee826edd383254dcb77ea435843904a53d10a8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-06-13 14:49:36 +00:00
hjk
5f26fe6298 Debugger: Robustify DebuggerRunTool::showMessage()
Seems to be possible to trigger in a failing MinGW start on Windows.

Change-Id: Ica93c29ad677c24688a8cf2c5a0f1018471ffe51
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-11 08:01:46 +00:00
hjk
77d2cebc12 Debugger: Use Utils::FilePath for serverStartScript
Change-Id: Ia3c6263a8f020b90c6f623a6cf88169db8fc2865
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 10:12:41 +00:00
hjk
d965df6483 Debugger: Use new Utils::CommandLine in LocalProcessRunner
Change-Id: I41e67e5d52aa9a00d9e0fad3caf8da22391d2024
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-06-04 06:45:54 +00:00
hjk
4098be05b2 Utils: Extract a CommandLine structure from a QtcProcess
We regularly pass around strings or filenames or pairs of strings
or filenames and stringlist etc the in the end will be used
as a kind of "command line", with quite a bit of ad-hoc user
code and QtcProcess::addArg etc to set them up and manipulate them.

Let's have a class for that concept.

Change-Id: I288ab939d853b32c717135a65242c584c2beab50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-29 14:36:46 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
hjk
2b1c8aa877 ProjectExplorer: Introduce a alias for QList<Tasks>
Change-Id: I91391ad22b420926b0f512cac23cfe009048b218
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 05:51:40 +00:00
Orgad Shaneh
39ba01da71 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7d1912cd5c4d824fd40d3454c5f1bb796f2c21d8
2019-04-07 23:13:17 +03:00
hjk
5273ef2a8a Debugger: Re-organize dock widget persisting
Looks like the mainwindow cannot be convinced to handle multiple
sets of dockwidgets.

So switch back to a single set containing everything and keep
track of non-default visibility in the perspectives, and persist
these sets.

The following pass:

1.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check: Debugger Selected, Break on right, Global log visible

2.

 Start Creator with new settings
 Goto Debug Mode
 Move Break dock widget to right, switch on Global log widget
 Switch to QmlProfiler sub-perspective
 Leave Creator
 Start Creator
 Goto Debug Mode
 Check QmlProfiler selected
 Switch to Debugger sub-perspective
 Check: Debugger Selected, Break on right, Global log visible

3.

 Start Creator with new settings
 Use any C++ test project
 Start debugging / stop at main()  (F10)
 Wait for stop
 Switch to Edit mode
 Switch back to Debug mode
 Check: Only "running" debugger dock widget layout present
  (not the normal + preset at the same time)
 Quit Qt Creator while this debugger is running
 Check: Shuts down without crash

4.
 Use any C++ test project
 Start debugging
 Switch to Debugger Preset perspective
 Start a second debugger
 Kill either instance
 Check: Application dies, Debugger Preset perspective gets displayed
 Switch to perspective of second instance
 Check: Perspective looks ok (docks visible as before)

Task-number: QTCREATORBUG-21083
Task-number: QTCREATORBUG-21669
Task-number: QTCREATORBUG-21668
Task-number: QTCREATORBUG-21813
Task-number: QTCREATORBUG-21851
Task-number: QTCREATORBUG-22110
Task-number: QTCREATORBUG-22169
Task-number: QTCREATORBUG-22189
Change-Id: Ic9eb41ff7699ac0f48a85e68376daa80b2b6847e
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-04-05 15:53:51 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
hjk
7a4752bde5 Debugger: Avoid some uses of RunControl::runConfiguration()
Change-Id: I1dcf5b96e6c23e369217f38a440305abb51dcd25
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-14 08:16:57 +00:00
hjk
ceb0fe429d ProjectExplorer: Add RunControl::set{Kit,Target}
For cases where no genuine RunConfiguration is available.

Use it in the debugger for the cases triggered from the menu.

Change-Id: I5671f4f5db2547c4a7a70bd34292bb6ccc8e6bf4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:47:47 +00:00
hjk
efb7d8deb7 ProjectExplorer: Split RunControl constructor
Into a trivial bit and two setters. Plan is to use it only with information
that is truly there (e.g. kit/device only) at the user side without having
to invent a RunConfiguration "handle".

Also remove some dead code in the test runner.

Change-Id: I987881e41722178b14b91f973b84cbdb67a9f85e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-12 16:38:45 +00:00
David Schulz
762bcc5c39 Debugger: inform user about misconfigured debugger settings
Change-Id: I304ae5147e04a89cd93800f8c44e82bd507f2d20
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-06 08:49:13 +00:00
hjk
317ab49793 Debugger: Code cosmetics
Move some constants to internalconstants.h or remove them entirely.

Change-Id: Iecd4def3b48130fb390bddf420da672d44e3d6b8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-21 07:56:58 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Friedemann Kleint
963dc84cc5 Fix some deprecation warnings in basic plugins
Fix warnings apppearing in 5.13, for example:
warning: ‘QDir& QDir::operator=(const QString&)’ is deprecated: Use QDir::setPath() instead [-Wdeprecated-declarations]
...
warning: ‘static QRgb QColorDialog::getRgba(QRgb, bool*, QWidget*)’ is deprecated: Use getColor() [-Wdeprecated-declarations]
warning: ‘Qt::DropAction QDrag::start(Qt::DropActions)’ is deprecated: Use QDrag::exec() instead [-Wdeprecated-declarations]
warning: ‘void QProcess::finished(int)’ is deprecated: Use QProcess::finished(int, QProcess::ExitStatus) instead [-Wdeprecated-declarations]
...
warning: ‘const QRect QDesktopWidget::availableGeometry(int) const’ is deprecated: Use QGuiApplication::screens() [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::background() const’ is deprecated: Use QPalette::window() instead [-Wdeprecated-declarations]
...
warning: ‘const QBrush& QPalette::foreground() const’ is deprecated: Use QPalette::windowText() instead [-Wdeprecated-declarations]
...
warning: ‘void QTextOption::setTabStop(qreal)’ is deprecated [-Wdeprecated-declarations]
warning: ‘void QList<T>::swap(int, int) [with T = ProjectExplorer::BuildStep*]’ is deprecated: Use QList<T>::swapItemsAt() [-Wdeprecated-declarations]
warning: ‘void QProcess::setReadChannelMode(QProcess::ProcessChannelMode)’ is deprecated: Use QProcess::setProcessChannelMode() instead [-Wdeprecated-declarations]
...
warning: ‘QString QFileInfo::readLink() const’ is deprecated: Use QFileInfo::symLinkTarget() instead [-Wdeprecated-declarations]

Change-Id: I1d893d42d372245892f2de8406f52dbe7bbd552a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-11 09:32:06 +00:00
Alessandro Portale
128a33548b Fix warning: "Missing reference in range-for with non trivial type"
[-Wclazy-range-loop]

Change-Id: I5dcb263c754d423740e7bce3dcb948d52f2dec67
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-01-16 20:22:56 +00:00
Eike Ziller
95db30bd3a Merge remote-tracking branch 'origin/4.8'
Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
2018-10-22 09:53:54 +02:00
hjk
d0d83f6b31 Debugger: Remove unused DebuggerRunTool::quitDebugger
Change-Id: Id3b59f9651ebc65e3fc7588bea789ccaa96522af
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 12:03:41 +00:00
Orgad Shaneh
147a3c27c4 Debugger: Strip QLatin1* where possible
Change-Id: Idcab23875b5dc2ecf55e3303f417b995e2252720
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:32:31 +00:00
hjk
1c9410e353 ProjectExplorer: Rename 'extraAspect' to 'aspect'
Using aspects is the standard pattern nowadays, there's nothing 'extra'
to them anymore.

Change-Id: I446f9d7b1db58a4899e5e44df33ce51f655e7be4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-10-02 08:32:51 +00:00
hjk
92325c90ce Debugger: Rename snapshothandler.{cpp,h} to enginemanager.{cpp,h}
That's what they are nowadays.

Change-Id: I1bd6db18f2142ecf488eba51ca739675eac753c7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-28 07:38:55 +00:00
hjk
bdc1ea1d74 Debugger: Do not remember persistent layout settings per engine
Fixes: QTCREATORBUG-21006
Change-Id: Id3c2062eb5b42808d666f0fc3620a82666fe14a2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 08:48:31 +00:00
Ulf Hermann
4ecc46626b FileInProjectFinder/Debugger: Use Utils::FileName for sysroot
Change-Id: Id937f927ba6137fd04f742f31d1b260afbe42db4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-28 07:27:30 +00:00
Ulf Hermann
33a0ab8943 FileInProjectFinder/Debugger: Use FileNameList for search directories
Change-Id: I8f9fa4631fda26e10e6b21abfcba9e5f74d635c2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:59:11 +00:00
Ulf Hermann
9bbef89cdc FileInProjectFinder/Debugger: Use Utils::FileName for project directory
Change-Id: I5a3f376bea4ee06c6856e614f6f71974c2f5ca87
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-27 08:58:14 +00:00
hjk
0303b84fff Debugger: Fix switch from and to sub-perspectives
Change-Id: I17d3b7eb6416843b7a330da14528f0670cd88452
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-23 12:17:39 +00:00
hjk
263cf4c608 ProjectExplorer: Remove RunWorker::setDisplayName
It has been an obsolete alias for setId for a while and downstream
uses have been adapted.

Change-Id: I467370aa67054599c7771e8275d28e62ddc461fa
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-08-21 08:02:22 +00:00
hjk
6ab30dcef7 Debugger: Make qmlServer url again accessible in DebuggerRunTool
Currently needed by GammaRayIntegration.

Change-Id: I0915e4bf02bd9be3f1fe0342b9b9ce543811a9ca
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-20 11:40:18 +00:00
hjk
7866f62892 Debugger: Fix core file loading
Amends 99e3635ef.

Change-Id: I0146416af32a6464765de008630ca1a1a05231a7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-08-17 12:35:45 +00:00
hjk
3b5ecac238 Debugger: Make most views per-engine instead of singletons
This is a step towards properly supporting multiple debugger
sessions side-by-side.

The combined C++-and-QML engine has been removed, instead a
combined setup creates now two individual engines, under a single
DebuggerRunTool but mostly independent with no combined state
machine. This requires a few more clicks in some cases, but
makes it easier to direct e.g. interrupt requests to the
interesting engine.

Care has been taken to not change the UX of the single debugger
session use case if possible. The fat debug button operates
as-before in that case, i.e. switches to Interrupt if the
single active runconfiguration runs in the debugger etc.

Most views are made per-engine, running an engine creates
a new Perspective, which is destroyed when the run control dies.

The snapshot view remains global and becomes primary source
of information on a "current engine" that receives all menu
and otherwise global input.

There is a new global "Breakpoint Preset" view containing
all "static" breakpoint data. When an engine starts up it
"claims" breakpoint it believes it can handle, but operates
on a copy of the static data. The markers of the static
version are suppressed as long as an engine controls a
breakpoint (that inclusive all resolved locations), but are
re-instatet once the engine quits.

The old Breakpoint class that already contained this split
per-instance was split into a new Breakpoint and a
GlobalBreakpoint class, with a per-engine model for Breakpoints,
and a singleton model containing GlobalBreakpoints.

There is a new CppDebuggerEngine intermediate level serving as
base for C++ (or, rather, "compiled") binary debugging, i.e.
{Gdb,Lldb,Cdb}Engine, taking over bits of the current DebuggerEngine
base that are not applicable to non-binary debuggers.

Change-Id: I9994f4c188379b4aee0c4f379edd4759fbb0bd43
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-08-17 12:35:15 +00:00
David Schulz
99e3635ef3 Debugger: remove redundant info whether to use cpp debugging
Task-number: QTCREATORBUG-20168
Change-Id: I2a0bfba6aea39da443032fd9ab02869cdc508696
Reviewed-by: hjk <hjk@qt.io>
2018-07-26 06:40:33 +00:00
Alessandro Portale
0558db7b54 Debugger: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: I91a6874f0d7b94e9079ab4ef07c23c60c80be9c0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-07-25 12:52:43 +00:00
hjk
0fbb2839f9 Remove ApplicationLauncher::Mode
The actual remaining use was to pop up a terminal in some
setups where Mode == Console, with a default of Gui meaning
"no console". In some downstream uses it was used set to
Console (probably to mean "this helper process does not need
a gui") but then luckily ignored when actually starting the
helper processes.

All cases where the console is useful and requested are
nowadays RunWorkers belonging to RunConfigurations with
a TerminalAspect, so they can directly get the relevant bit
from their RunConfiguration without having it part of
all StandardRunnables.

Change-Id: I1368d5968da5cf672656aebf200ccac8d45335d0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-06-05 15:08:29 +00:00
hjk
4feb2259d9 Debugger: Code cosmetics
Sprinkling in const and ranged for.

Change-Id: I5d11d57f64140021397c23734c7373544ebebb6f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-31 07:10:47 +00:00
hjk
449a749dd7 Debugger: Move part of debugger ramp-down to DebuggerRunTool
DebuggerRunTool and debugger backend process have (almost) a 1:1
correspondence, unlike engines or the debugger plugin itself.
So it makes sense to accumulate backend start/rampdown login
in DebuggerRunTool.

Change-Id: Ia105283bcdf2641c7e9a401b4146b34c20605ba7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-05-29 11:59:36 +00:00
Tim Jenssen
b5a4e88485 FileInProjectFinder: Use FileNameList for file names
This simplifies code and reduces the number of conversions between
QString and Utils::FileName.

Change-Id: I47bd86b9ae09b1da37b4e5e604761367ac1ab26b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-05-24 10:09:26 +00:00
hjk
36b835ff0a Finish merging Runnable and StandardRunnable
As all Runnables are known to be StandardRunnables, this here
essentially replaces all .is<StandardRunnable> by 'true'.
.as<StandardRunnable> by no-op, and fixes the fallout.

Change-Id: I1632f8e164fa0a9dff063df47a9e191fdf7bbb2e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-05-23 08:48:36 +00:00
hjk
d6af336a7e RemoteLinux/Debugger: Use SymbolFileAspect
This is/will be optionally available independent of the concrete
run configuration type, so use it.

Change-Id: Ife0e906ff47e916d2f7a9df73af8cdd83635cd65
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-24 06:00:36 +00:00
Ulf Hermann
17d530d60d Make sure we always quote the qmldebug command line arguments
Change-Id: I5ce68c238e0ab05d19715659a9cc2161e51e1a7e
Task-number: QTCREATORBUG-20260
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-16 13:08:45 +00:00
David Schulz
43f02573df Debugger: Use shared TerminalRunner also for CDB
Task-number: QTCREATORBUG-19633
Change-Id: Ic16335de1c5e57da7d9253772bad9e4ade1db926
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-01-30 11:20:45 +00:00
David Schulz
f33ef0e80b Debugger: automatically add source path mapping for Qt packages
Change-Id: I1199629729e3996adb574089c5db69f1fcf0ccd0
Reviewed-by: hjk <hjk@qt.io>
2018-01-15 13:53:01 +00:00
hjk
c06212a255 Debugger: Use more QUrl in channel-ish interfaces
Change-Id: I978b18b4d79ce927ae4801955558b9f24dbcb64e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-12-20 09:36:14 +00:00
hjk
21c66ce5fd Combine some SshConnectionParameter members
Combine host, port, username and password into a 'url' member and
add some convenience accessors.

Change-Id: Iddc26ff00dad1285c96aa56f196dbc4febe8e974
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2017-12-19 14:19:31 +00:00