Debugger: Merge debug mode and analyze mode

On the user-visible side, only the 'Analyze' mode button disappears,
and instead a combobox to switch between different tools in appears
in the Debug mode toolbar.

Internally, that's quite some re-organzition: The centralized
'Analyze mode is busy' flag is gone, allowing us to run e.g.
ClangStaticAnalyzer and MemCheck in parallel.

Analyzer tools and debugger now share the same mechanism to
generate/load/save dock widgets.

Analyzer tools now create and handle their own start/stop button
when appropriate. In general, Analyzer tools can create/handle more
than one run control at a time.

Further consolidation is possible, e.g. RunControl state handling
could be merged into the base ProjectExplorer::RunControl to
avoid the still existing duplication in ~15 instances.

Change-Id: I91e5940ebc4211f98056d507cf2f7b5f8efe7f07
Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
hjk
2016-03-02 13:57:37 +01:00
parent c326011feb
commit 92e301a054
79 changed files with 2135 additions and 2642 deletions

View File

@@ -43,7 +43,7 @@
#define VALGRIND_DEBUG_OUTPUT 0
using namespace Analyzer;
using namespace Debugger;
using namespace Core;
using namespace Utils;
using namespace ProjectExplorer;
@@ -65,10 +65,8 @@ ValgrindRunControl::ValgrindRunControl(RunConfiguration *runConfiguration, Core:
m_settings = ValgrindPlugin::globalSettings();
}
bool ValgrindRunControl::startEngine()
void ValgrindRunControl::start()
{
emit starting();
FutureProgress *fp = ProgressManager::addTimedTask(m_progress, progressTitle(), "valgrind", 100);
fp->setKeepOnFinish(FutureProgress::HideOnFinish);
connect(fp, &FutureProgress::canceled,
@@ -86,7 +84,6 @@ bool ValgrindRunControl::startEngine()
ValgrindRunner *run = runner();
run->setValgrindExecutable(m_settings->valgrindExecutable());
run->setValgrindArguments(genericToolArguments() + toolArguments());
QTC_ASSERT(!device().isNull(), return false);
run->setDevice(device());
run->setDebuggee(runnable().as<StandardRunnable>());
@@ -99,15 +96,24 @@ bool ValgrindRunControl::startEngine()
if (!run->start()) {
m_progress.cancel();
return false;
emit finished();
return;
}
return true;
m_isRunning = true;
emit started();
}
void ValgrindRunControl::stopEngine()
RunControl::StopResult ValgrindRunControl::stop()
{
m_isStopping = true;
runner()->stop();
return AsynchronousStop;
}
bool ValgrindRunControl::isRunning() const
{
return m_isRunning;
}
QString ValgrindRunControl::executable() const
@@ -139,7 +145,6 @@ QStringList ValgrindRunControl::genericToolArguments() const
void ValgrindRunControl::handleProgressCanceled()
{
AnalyzerManager::stopTool();
m_progress.reportCanceled();
m_progress.reportFinished();
}
@@ -151,6 +156,8 @@ void ValgrindRunControl::handleProgressFinished()
void ValgrindRunControl::runnerFinished()
{
m_isRunning = false;
appendMessage(tr("Analyzing finished.") + QLatin1Char('\n'), NormalMessageFormat);
emit finished();