forked from qt-creator/qt-creator
Debugger: Clean out fixupParameters
Change-Id: I01b1308f4d438b7e0cb4ae643b79abd285ea9db7 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -288,13 +288,15 @@ DebuggerEngine *createEngine(DebuggerEngineType cppEngineType,
|
|||||||
static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, QStringList &m_errors)
|
static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, QStringList &m_errors)
|
||||||
{
|
{
|
||||||
RunConfiguration *runConfig = runControl->runConfiguration();
|
RunConfiguration *runConfig = runControl->runConfiguration();
|
||||||
|
if (!runConfig)
|
||||||
|
return false;
|
||||||
Core::Id runMode = runControl->runMode();
|
Core::Id runMode = runControl->runMode();
|
||||||
|
|
||||||
const Kit *kit = runConfig->target()->kit();
|
const Kit *kit = runConfig->target()->kit();
|
||||||
QTC_ASSERT(kit, return false);
|
QTC_ASSERT(kit, return false);
|
||||||
|
|
||||||
// Extract as much as possible from available RunConfiguration.
|
// Extract as much as possible from available RunConfiguration.
|
||||||
if (runConfig && runConfig->runnable().is<StandardRunnable>()) {
|
if (runConfig->runnable().is<StandardRunnable>()) {
|
||||||
rp.inferior = runConfig->runnable().as<StandardRunnable>();
|
rp.inferior = runConfig->runnable().as<StandardRunnable>();
|
||||||
rp.useTerminal = rp.inferior.runMode == ApplicationLauncher::Console;
|
rp.useTerminal = rp.inferior.runMode == ApplicationLauncher::Console;
|
||||||
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
|
// Normalize to work around QTBUG-17529 (QtDeclarative fails with 'File name case mismatch'...)
|
||||||
@@ -320,7 +322,6 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
|
|||||||
if (!envBinary.isEmpty())
|
if (!envBinary.isEmpty())
|
||||||
rp.debugger.executable = QString::fromLocal8Bit(envBinary);
|
rp.debugger.executable = QString::fromLocal8Bit(envBinary);
|
||||||
|
|
||||||
if (runConfig) {
|
|
||||||
if (auto envAspect = runConfig->extraAspect<EnvironmentAspect>()) {
|
if (auto envAspect = runConfig->extraAspect<EnvironmentAspect>()) {
|
||||||
rp.inferior.environment = envAspect->environment(); // Correct.
|
rp.inferior.environment = envAspect->environment(); // Correct.
|
||||||
rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
|
rp.stubEnvironment = rp.inferior.environment; // FIXME: Wrong, but contains DYLD_IMAGE_SUFFIX
|
||||||
@@ -334,19 +335,9 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
|
|||||||
rp.projectSourceDirectory = project->projectDirectory().toString();
|
rp.projectSourceDirectory = project->projectDirectory().toString();
|
||||||
rp.projectSourceFiles = project->files(Project::SourceFiles);
|
rp.projectSourceFiles = project->files(Project::SourceFiles);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// "special" starts like Start and Debug External Application.
|
|
||||||
rp.inferior.environment = Environment::systemEnvironment();
|
|
||||||
rp.inferior.environment.modify(EnvironmentKitInformation::environmentChanges(kit));
|
|
||||||
}
|
|
||||||
|
|
||||||
rp.toolChainAbi = ToolChainKitInformation::targetAbi(kit);
|
rp.toolChainAbi = ToolChainKitInformation::targetAbi(kit);
|
||||||
|
|
||||||
if (false) {
|
|
||||||
const QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
|
|
||||||
rp.nativeMixedEnabled = version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 7, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
int nativeMixedOverride = qgetenv("QTC_DEBUGGER_NATIVE_MIXED").toInt(&ok);
|
int nativeMixedOverride = qgetenv("QTC_DEBUGGER_NATIVE_MIXED").toInt(&ok);
|
||||||
if (ok)
|
if (ok)
|
||||||
@@ -356,10 +347,10 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
|
|||||||
if (rp.sysRoot.isEmpty())
|
if (rp.sysRoot.isEmpty())
|
||||||
rp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
rp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||||
|
|
||||||
if (rp.displayName.isEmpty() && runConfig)
|
if (rp.displayName.isEmpty())
|
||||||
rp.displayName = runConfig->displayName();
|
rp.displayName = runConfig->displayName();
|
||||||
|
|
||||||
if (runConfig && runConfig->property("supportsDebugger").toBool()) {
|
if (runConfig->property("supportsDebugger").toBool()) {
|
||||||
QString mainScript = runConfig->property("mainScript").toString();
|
QString mainScript = runConfig->property("mainScript").toString();
|
||||||
QString interpreter = runConfig->property("interpreter").toString();
|
QString interpreter = runConfig->property("interpreter").toString();
|
||||||
if (!interpreter.isEmpty() && mainScript.endsWith(".py")) {
|
if (!interpreter.isEmpty() && mainScript.endsWith(".py")) {
|
||||||
@@ -375,14 +366,11 @@ static bool fixupParameters(DebuggerRunParameters &rp, RunControl *runControl, Q
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DebuggerRunConfigurationAspect *debuggerAspect = 0;
|
DebuggerRunConfigurationAspect *debuggerAspect
|
||||||
if (runConfig)
|
= runConfig->extraAspect<DebuggerRunConfigurationAspect>();
|
||||||
debuggerAspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
|
|
||||||
|
|
||||||
if (debuggerAspect)
|
|
||||||
rp.multiProcess = debuggerAspect->useMultiProcess();
|
|
||||||
|
|
||||||
if (debuggerAspect) {
|
if (debuggerAspect) {
|
||||||
|
rp.multiProcess = debuggerAspect->useMultiProcess();
|
||||||
rp.languages = NoLanguage;
|
rp.languages = NoLanguage;
|
||||||
if (debuggerAspect->useCppDebugger())
|
if (debuggerAspect->useCppDebugger())
|
||||||
rp.languages |= CppLanguage;
|
rp.languages |= CppLanguage;
|
||||||
|
Reference in New Issue
Block a user