Commit Graph

25 Commits

Author SHA1 Message Date
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
Jarek Kobus
239688180d Fix running as root
There is no need for TerminalRunner::setRunAsRoot()
as debugger is already being run as root.
Implement runAsRoot for non-terminal QtcProcess, too.

Fixes: QTCREATORBUG-26964
Change-Id: Id5110db86b7b809a5608714464241cee73875f2b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-02-03 10:23:25 +00:00
Jarek Kobus
a09630d50e TerminalRunner: Use QtcProcess in terminal mode instead of ConsoleProcess
Change-Id: I5ddc521ed62947a6bd09eb048408fc9573069615
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-01-25 14:56:28 +00:00
Jarek Kobus
74f522e0de ConsoleProcess: Make setSettings() a static member
Since it's not possible to use directly ICore::settings()
inside Utils lib, make setSettings() a static member.
This simplifies the API of other static methods.
Set the settings just once now, inside main().

Change-Id: I2bcc58d4d29b5aba4a1a21a98a9f4245b24b530f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-01-21 14:53:17 +00:00
Jarek Kobus
c4054b5d1c ConsoleProcess: Uniform the common interface of QtcProcess
This is a preliminary step before merging ConsoleProcess
into QtcProcess.

Don't return bool from start(), all callers ignored it.
Rename stop() to stopProcess().

Change-Id: I2fda1337e6f490685669fbd7ad6987a97866fdbe
Reviewed-by: hjk <hjk@qt.io>
2022-01-20 16:42:44 +00:00
Jarek Kobus
15479285e3 ConsoleProcess: Uniform the common interface of QtcProcess
This is a preliminary step before merging ConsoleProcess
into QtcProcess.

Rename applicationPID() to processId().

Change-Id: I1f9a28e768505c08c2ca3529c2ff0432f2a62c78
Reviewed-by: hjk <hjk@qt.io>
2022-01-20 16:42:38 +00:00
Jarek Kobus
70b2b2a1d5 ConsoleProcess: Uniform the common interface of QtcProcess
This is a preliminary step before merging ConsoleProcess
into QtcProcess.

Remove processError() signal, use errorOccurred() instead.

Change-Id: If11064944228c82a9099fffdba942c4276690085
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-20 07:51:04 +00:00
Jarek Kobus
404f7a1b31 ConsoleProcess: Uniform the common interface of QtcProcess
This is a preliminary step before merging ConsoleProcess
into QtcProcess.

Rename:
processStarted() -> started()
processFinished() -> finished()

Change-Id: Ifd94722822c7628fc8130e3a6377d55d24db6eb3
Reviewed-by: hjk <hjk@qt.io>
2022-01-19 10:03:46 +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
3560a86c2e Debugger: Delay evaluation of stub runnable environment
There can be modifications in the environment between the decision
to use a terminal and its start. We want them taken into account.

Change-Id: I5622614c5fac3bdd8167c29e7b618b5e42a28287
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-03-11 12:26:54 +00:00
hjk
89646aadce Utils: Don't raise SIGSTOP in the process stub
Previously, the starting inferior was sent a SIGSTOP to avoid
progress before the debugger could attach.

However, these signals are then also visible in the debugger and
need to be ignored as part of the startup handling in Creator.

The waiting effect can be achieved less intrusively by waiting
on a pipe read between fork() and exec().

Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Task-number: QTCREATORBUG-25227
Change-Id: Ie70b9eb5ea865f85411c26b0dbf377a019fec8d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-09 08:06:21 +00:00
hjk
c4b7da9ab2 ProjectExplorer/Debugger: Add a 'Run as root' option for Unix hosts
For local run and GDB debug, with or without terminal.

Task-number: QTCREATORBUG-2831
Task-number: QTCREATORBUG-25330
Change-Id: I9b5d2156bcffea4f358474ecdbcad580a4419917
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-22 13:38:25 +00:00
hjk
12a0934830 Utils: Add the ability to interrupt inferiors via the process stub
This will be handy once we want to debug processes running as root.

The mechanism is the same as for "killProcess", and currently unused.

Change-Id: I2c5e5b77577ca32ed1118fcc81c03c6320db8800
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-16 09:57:00 +00:00
hjk
251287f0d3 Avoid warning on empty expressions
For some reason, Q_UNUSED includes already a semicolon, adding one
on the user side creates an additional empty statement.

Change-Id: I9c5e8fac381345a60792cb75e2938fd53958d3b0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-07-23 11:55:59 +00:00
hjk
465d4cc845 Utils: Use CommandLine in ConsoleProcess
Change-Id: I380b91513fa342819cba898196c91443622d0ae2
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-06-13 07:28:45 +00:00
Orgad Shaneh
f9da340c6b Debugger: Remove obsolete condition
We don't support Windows earlier than 7.

Change-Id: I5782e65ad4e6fb1c8acd9d083ccc410133178cd5
Reviewed-by: hjk <hjk@qt.io>
2018-09-21 06:55:09 +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
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
hjk
1b87d19a64 Debugger: Modernize
Mostly nullptr instead of 0, but also a few bits of collateral damage.

Change-Id: I921991272aca921dcdecf302dfff3716e79dfc24
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-02-01 10:28:54 +00:00
David Schulz
ba54fa8a10 Debugger: Do not override environment when using run in terminal
Change-Id: I4ab30bb81462de34c4c7f9c4ef0b10f7731f5bcc
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2017-10-16 12:15:11 +00:00
Orgad Shaneh
e098134d43 Debugger: Report done when terminal *process* is stopped
Do not wait until the stub exits.

Task-number: QTCREATORBUG-19056
Change-Id: I7c4c3438c960a6e418ccd6c9d96d01d9621e9b02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-10-16 09:24:03 +00:00
hjk
895acd23e3 Debugger: Move external terminal into separate RunWorker
Change-Id: Ifb9701f840195ba90db48a0f6fa07b28e0409648
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-09-27 12:16:19 +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
Leena Miettinen
2bf6152495 Debugger: fix UI text capitalization and punctuation
Added full stops to ends of messages.
Used book-style capitalization for message box titles.
Wrote "operating system" in lower case.

Change-Id: I8cee1a1c7f4ae55952daa507395845feae203ab9
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-03-16 15:15:24 +00:00
hjk
3c8a8eb8e8 Debugger: Introduce a pty based channel to inferiors
This is experimental for now and requires QTC_USE_PTY=1
in the environment to be used.

Change-Id: I460ce7b9283467d481e903f731f4243b7e5ec094
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@theqtcompany.com>
Reviewed-by: hjk <hjk@theqtcompany.com>
2015-01-26 09:43:19 +01:00