forked from qt-creator/qt-creator
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:
@@ -53,7 +53,7 @@
|
||||
|
||||
#include <QtPlugin>
|
||||
|
||||
using namespace Analyzer;
|
||||
using namespace Debugger;
|
||||
|
||||
namespace ClangStaticAnalyzer {
|
||||
namespace Internal {
|
||||
@@ -122,36 +122,10 @@ bool ClangStaticAnalyzerPlugin::initialize(const QStringList &arguments, QString
|
||||
panelFactory->setSimpleCreateWidgetFunction<ProjectSettingsWidget>(QIcon());
|
||||
ProjectExplorer::ProjectPanelFactory::registerFactory(panelFactory);
|
||||
|
||||
auto tool = m_analyzerTool = new ClangStaticAnalyzerTool(this);
|
||||
m_analyzerTool = new ClangStaticAnalyzerTool(this);
|
||||
addAutoReleasedObject(new ClangStaticAnalyzerRunControlFactory(m_analyzerTool));
|
||||
addAutoReleasedObject(new ClangStaticAnalyzerOptionsPage);
|
||||
|
||||
AnalyzerManager::registerToolbar(ClangStaticAnalyzerPerspectiveId, tool->createWidgets());
|
||||
|
||||
auto runControlCreator = [tool](ProjectExplorer::RunConfiguration *runConfiguration,
|
||||
Core::Id runMode) {
|
||||
return tool->createRunControl(runConfiguration, runMode);
|
||||
};
|
||||
|
||||
const QString toolTip = tr("Clang Static Analyzer uses the analyzer from the clang project "
|
||||
"to find bugs.");
|
||||
|
||||
AnalyzerManager::registerPerspective(ClangStaticAnalyzerPerspectiveId, {
|
||||
{ ClangStaticAnalyzerDockId, Core::Id(), Perspective::SplitVertical }
|
||||
});
|
||||
|
||||
ActionDescription desc;
|
||||
desc.setText(tr("Clang Static Analyzer"));
|
||||
desc.setToolTip(toolTip);
|
||||
desc.setRunMode(Constants::CLANGSTATICANALYZER_RUN_MODE);
|
||||
desc.setPerspectiveId(ClangStaticAnalyzerPerspectiveId);
|
||||
desc.setRunControlCreator(runControlCreator);
|
||||
desc.setCustomToolStarter([tool](ProjectExplorer::RunConfiguration *rc) {
|
||||
tool->startTool(rc);
|
||||
});
|
||||
desc.setMenuGroup(Analyzer::Constants::G_ANALYZER_TOOLS);
|
||||
AnalyzerManager::registerAction(ClangStaticAnalyzerActionId, desc);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user