aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-11-16 12:29:25 +0100
committerhjk <hjk@qt.io>2017-11-16 13:12:11 +0000
commitc1d3e22511498a709131afa948d3a41563f58063 (patch)
treef864f80eb8d5755983411f76ec4af5395d0c2da5 /src
parentac1ce65a386aae6db2949b8684c9ea65fb946c78 (diff)
Debugger: Do not create a new terminal when attaching
... to a running application that already has one. Task-number: QTCREATORBUG-19302 Change-Id: Id83f840408c26f3db85dbe30dadac9949ce6b660 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/debuggerplugin.cpp2
-rw-r--r--src/plugins/debugger/debuggerruncontrol.cpp4
-rw-r--r--src/plugins/debugger/debuggerruncontrol.h3
3 files changed, 5 insertions, 4 deletions
diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp
index 1aeb3f6813..d1af5e3c4d 100644
--- a/src/plugins/debugger/debuggerplugin.cpp
+++ b/src/plugins/debugger/debuggerplugin.cpp
@@ -2103,7 +2103,7 @@ void DebuggerPlugin::attachExternalApplication(RunControl *rc)
ProcessHandle pid = rc->applicationProcessHandle();
RunConfiguration *runConfig = rc->runConfiguration();
auto runControl = new RunControl(runConfig, ProjectExplorer::Constants::DEBUG_RUN_MODE);
- auto debugger = new DebuggerRunTool(runControl, guessKitFromAbis({rc->abi()}));
+ auto debugger = new DebuggerRunTool(runControl, guessKitFromAbis({rc->abi()}), false);
debugger->setAttachPid(pid);
debugger->setRunControlName(tr("Process %1").arg(pid.pid()));
debugger->setStartMode(AttachExternal);
diff --git a/src/plugins/debugger/debuggerruncontrol.cpp b/src/plugins/debugger/debuggerruncontrol.cpp
index b873bf2106..a5ba691137 100644
--- a/src/plugins/debugger/debuggerruncontrol.cpp
+++ b/src/plugins/debugger/debuggerruncontrol.cpp
@@ -794,7 +794,7 @@ Internal::TerminalRunner *DebuggerRunTool::terminalRunner() const
return d->terminalRunner;
}
-DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit)
+DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit, bool allowTerminal)
: RunWorker(runControl), d(new DebuggerRunToolPrivate)
{
setDisplayName("DebuggerRunTool");
@@ -838,7 +838,7 @@ DebuggerRunTool::DebuggerRunTool(RunControl *runControl, Kit *kit)
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
m_runParameters.inferior.workingDirectory =
FileUtils::normalizePathName(m_runParameters.inferior.workingDirectory);
- setUseTerminal(m_runParameters.inferior.runMode == ApplicationLauncher::Console);
+ setUseTerminal(allowTerminal && m_runParameters.inferior.runMode == ApplicationLauncher::Console);
}
const QByteArray envBinary = qgetenv("QTC_DEBUGGER_PATH");
diff --git a/src/plugins/debugger/debuggerruncontrol.h b/src/plugins/debugger/debuggerruncontrol.h
index 1795b9bf68..5ab3e8efa8 100644
--- a/src/plugins/debugger/debuggerruncontrol.h
+++ b/src/plugins/debugger/debuggerruncontrol.h
@@ -47,7 +47,8 @@ class DEBUGGER_EXPORT DebuggerRunTool : public ProjectExplorer::RunWorker
public:
explicit DebuggerRunTool(ProjectExplorer::RunControl *runControl,
- ProjectExplorer::Kit *kit = nullptr);
+ ProjectExplorer::Kit *kit = nullptr,
+ bool allowTerminal = true);
~DebuggerRunTool();
Internal::DebuggerEngine *engine() const { return m_engine; }