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>
This commit is contained in:
hjk
2021-02-15 16:55:28 +01:00
parent 9bc9a4d376
commit c4b7da9ab2
15 changed files with 128 additions and 20 deletions

View File

@@ -1154,6 +1154,8 @@ SimpleTargetRunner::SimpleTargetRunner(RunControl *runControl)
setId("SimpleTargetRunner");
if (auto terminalAspect = runControl->aspect<TerminalAspect>())
m_useTerminal = terminalAspect->useTerminal();
if (auto runAsRootAspect = runControl->aspect<RunAsRootAspect>())
m_runAsRoot = runAsRootAspect->value();
}
void SimpleTargetRunner::start()
@@ -1169,6 +1171,7 @@ void SimpleTargetRunner::doStart(const Runnable &runnable, const IDevice::ConstP
m_stopReported = false;
m_launcher.disconnect(this);
m_launcher.setUseTerminal(m_useTerminal);
m_launcher.setRunAsRoot(m_runAsRoot);
const bool isDesktop = device.isNull() || device.dynamicCast<const DesktopDevice>();
const QString rawDisplayName = runnable.displayName();