forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.0'
Conflicts: qtcreator.pri qtcreator.qbs src/plugins/debugger/debuggerruncontrol.cpp Change-Id: I81b43480a1369e3d7be60ae26e812dda6b962b0b
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <projectexplorer/environmentaspect.h> // For the environment
|
||||
#include <projectexplorer/project.h>
|
||||
#include <projectexplorer/projectexplorer.h>
|
||||
#include <projectexplorer/projectexplorericons.h>
|
||||
#include <projectexplorer/runnables.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <projectexplorer/taskhub.h>
|
||||
@@ -54,7 +55,6 @@
|
||||
#include <utils/qtcprocess.h>
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/coreconstants.h>
|
||||
#include <coreplugin/coreicons.h>
|
||||
#include <qmldebug/qmldebugcommandlinearguments.h>
|
||||
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
@@ -111,7 +111,7 @@ DebuggerRunControl::DebuggerRunControl(RunConfiguration *runConfig, DebuggerEngi
|
||||
m_engine(engine),
|
||||
m_running(false)
|
||||
{
|
||||
setIcon(Core::Icons::DEBUG_START_SMALL);
|
||||
setIcon(ProjectExplorer::Icons::DEBUG_START_SMALL);
|
||||
connect(this, &RunControl::finished, this, &DebuggerRunControl::handleFinished);
|
||||
|
||||
connect(engine, &DebuggerEngine::requestRemoteSetup,
|
||||
@@ -321,6 +321,7 @@ void DebuggerRunControlCreator::initialize(const DebuggerStartParameters &sp)
|
||||
void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const Kit *kit)
|
||||
{
|
||||
m_runConfig = runConfig;
|
||||
QTC_ASSERT(kit, return);
|
||||
|
||||
Target *target = 0;
|
||||
Project *project = 0;
|
||||
@@ -329,13 +330,6 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
|
||||
if (m_runConfig)
|
||||
target = m_runConfig->target();
|
||||
|
||||
if (!kit && target)
|
||||
kit = target->kit();
|
||||
|
||||
// Make sure we have something sensible to start with.
|
||||
m_rp.inferior.runMode = ApplicationLauncher::Console;
|
||||
m_rp.useTerminal = false;
|
||||
|
||||
// Extract as much as possible from available RunConfiguration.
|
||||
if (m_runConfig && m_runConfig->runnable().is<StandardRunnable>()) {
|
||||
m_rp.inferior = m_runConfig->runnable().as<StandardRunnable>();
|
||||
@@ -351,46 +345,6 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
|
||||
m_rp.inferior.executable = p.exe;
|
||||
}
|
||||
|
||||
if (!kit) {
|
||||
// This code can only be reached when starting via the command line
|
||||
// (-debug pid or executable) or attaching from runconfiguration
|
||||
// without specifying a kit. Try to find a kit via ABI.
|
||||
QList<Abi> abis;
|
||||
if (m_rp.toolChainAbi.isValid()) {
|
||||
abis.push_back(m_rp.toolChainAbi);
|
||||
} else if (!m_rp.inferior.executable.isEmpty()) {
|
||||
abis = Abi::abisOfBinary(FileName::fromString(m_rp.inferior.executable));
|
||||
}
|
||||
|
||||
if (!abis.isEmpty()) {
|
||||
// Try exact abis.
|
||||
kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
|
||||
if (const ToolChain *tc = ToolChainKitInformation::toolChain(k))
|
||||
return abis.contains(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k);
|
||||
return false;
|
||||
}));
|
||||
if (!kit) {
|
||||
// Or something compatible.
|
||||
kit = KitManager::find(KitMatcher([abis](const Kit *k) -> bool {
|
||||
if (const ToolChain *tc = ToolChainKitInformation::toolChain(k))
|
||||
foreach (const Abi &a, abis)
|
||||
if (a.isCompatibleWith(tc->targetAbi()) && DebuggerKitInformation::isValidDebugger(k))
|
||||
return true;
|
||||
return false;
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!kit)
|
||||
kit = KitManager::defaultKit();
|
||||
|
||||
// We really should have a kit now.
|
||||
if (!kit) {
|
||||
m_errors.append(DebuggerKitInformation::tr("No kit found."));
|
||||
return;
|
||||
}
|
||||
|
||||
m_rp.macroExpander = kit->macroExpander();
|
||||
|
||||
if (m_runConfig) {
|
||||
@@ -416,7 +370,7 @@ void DebuggerRunControlCreator::enrich(const RunConfiguration *runConfig, const
|
||||
if (project && m_rp.projectSourceFiles.isEmpty())
|
||||
m_rp.projectSourceFiles = project->files(Project::SourceFiles);
|
||||
|
||||
if (false && project && kit) {
|
||||
if (false && project) {
|
||||
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
||||
m_rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0);
|
||||
}
|
||||
@@ -622,7 +576,7 @@ public:
|
||||
// We cover only local setup here. Remote setups are handled by the
|
||||
// RunControl factories in the target specific plugins.
|
||||
DebuggerRunControlCreator creator;
|
||||
creator.enrich(runConfig, 0);
|
||||
creator.enrich(runConfig, runConfig->target()->kit());
|
||||
creator.createRunControl(mode);
|
||||
if (errorMessage)
|
||||
*errorMessage = creator.fullError();
|
||||
@@ -660,6 +614,7 @@ QObject *createDebuggerRunControlFactory(QObject *parent)
|
||||
*/
|
||||
DebuggerRunControl *createAndScheduleRun(const DebuggerRunParameters &rp, const Kit *kit)
|
||||
{
|
||||
QTC_ASSERT(kit, return 0); // Caller needs to look for a suitable kit.
|
||||
DebuggerRunControlCreator creator;
|
||||
creator.m_rp = rp;
|
||||
creator.enrich(0, kit);
|
||||
@@ -683,9 +638,10 @@ DebuggerRunControl *createDebuggerRunControl(const DebuggerStartParameters &sp,
|
||||
QString *errorMessage,
|
||||
Core::Id runMode)
|
||||
{
|
||||
QTC_ASSERT(runConfig, return 0);
|
||||
DebuggerRunControlCreator creator;
|
||||
creator.initialize(sp);
|
||||
creator.enrich(runConfig, 0);
|
||||
creator.enrich(runConfig, runConfig->target()->kit());
|
||||
creator.createRunControl(runMode);
|
||||
if (errorMessage)
|
||||
*errorMessage = creator.fullError();
|
||||
|
Reference in New Issue
Block a user