Analyzer: Slim down AnalyzerStartParameters

* SysRoot can always be determined from kit.
* Pass around RunMode as extra parameter
  not as part of AnalyzerStartParameters.
  That's closer to the pattern used elsewhere.
* Environment was always initialized from the runconfig's
  EnvironmentAspect. The tools can do that directly.
* Provide setter for display name for cases where
  it is not equal to RunConfiguration::displayName

Change-Id: I811a0d7cdeb55cc37a16a593b3942abb567a2150
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
hjk
2016-01-06 11:40:52 +01:00
parent 3120692092
commit 8150209ff7
29 changed files with 177 additions and 219 deletions

View File

@@ -429,13 +429,17 @@ QWidget *MemcheckTool::createWidgets()
}
MemcheckRunControl *MemcheckTool::createRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
RunConfiguration *runConfiguration,
Core::Id runMode)
{
m_frameFinder->setFiles(runConfiguration ? runConfiguration->target()
->project()->files(Project::AllFiles) : QStringList());
MemcheckRunControl *engine = createMemcheckRunControl(sp, runConfiguration);
MemcheckRunControl *engine = 0;
if (runMode == MEMCHECK_RUN_MODE)
engine = new MemcheckRunControl(sp, runConfiguration, runMode);
else
engine = new MemcheckWithGdbRunControl(sp, runConfiguration);
connect(engine, &MemcheckRunControl::starting, this, &MemcheckTool::engineStarting);
connect(engine, &MemcheckRunControl::parserError, this, &MemcheckTool::parserError);
connect(engine, &MemcheckRunControl::internalParserError, this, &MemcheckTool::internalParserError);
@@ -567,12 +571,6 @@ int MemcheckTool::updateUiAfterFinishedHelper()
return issuesFound;
}
MemcheckRunControl *MemcheckTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
return new MemcheckRunControl(sp, runConfiguration);
}
void MemcheckTool::engineFinished()
{
const int issuesFound = updateUiAfterFinishedHelper();
@@ -595,17 +593,5 @@ void MemcheckTool::setBusyCursor(bool busy)
m_errorView->setCursor(cursor);
}
MemcheckWithGdbTool::MemcheckWithGdbTool(QObject *parent) :
MemcheckTool(parent)
{
setObjectName(QLatin1String("MemcheckWithGdbTool"));
}
MemcheckRunControl *MemcheckWithGdbTool::createMemcheckRunControl(const AnalyzerStartParameters &sp,
RunConfiguration *runConfiguration)
{
return new MemcheckWithGdbRunControl(sp, runConfiguration);
}
} // namespace Internal
} // namespace Valgrind