Merge remote-tracking branch 'origin/4.8'

Conflicts:
	src/plugins/debugger/debuggeritem.cpp
	tests/unit/unittest/unittest.pro

Change-Id: Id2e4e9c2bc87b2556d7c2845aea3fe2fa11b630b
This commit is contained in:
Eike Ziller
2018-10-22 09:53:54 +02:00
151 changed files with 2927 additions and 1910 deletions

View File

@@ -768,7 +768,7 @@ public:
Action m_interruptAction{tr("Interrupt"), interruptIcon(false), &DebuggerEngine::handleExecInterrupt};
Action m_abortAction{tr("Abort Debugging"), {}, &DebuggerEngine::abortDebugger,
tr("Aborts debugging and resets the debugger to the initial state.")};
QAction m_stepAction{tr("Step Into")};
QAction m_stepInAction{tr("Step Into")};
Action m_stepOutAction{tr("Step Out"), Icons::STEP_OUT.icon(), &DebuggerEngine::handleExecStepOut};
Action m_runToLineAction{tr("Run to Line"), {}, &DebuggerEngine::handleExecRunToLine};
@@ -776,7 +776,8 @@ public:
Action m_jumpToLineAction{tr("Jump to Line"), {}, &DebuggerEngine::handleExecJumpToLine};
// In the Debug menu.
Action m_returnFromFunctionAction{tr("Immediately Return From Inner Function"), {}, &DebuggerEngine::executeReturn};
QAction m_nextAction{tr("Step Over")};
QAction m_stepOverAction{tr("Step Over")};
QAction m_startAndBreakOnMain{tr("Start and Break on Main")};
Action m_watchAction{tr("Add Expression Evaluator"), {}, &DebuggerEngine::handleAddToWatchWindow};
Command *m_watchCommand = nullptr;
QAction m_breakAction{tr("Toggle Breakpoint")};
@@ -1012,6 +1013,11 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
QString *errorMessage)
{
Q_UNUSED(errorMessage);
const Context debuggerRunning(C_DEBUGGER_RUNNING);
const Context debuggerNotRunning(C_DEBUGGER_NOTRUNNING);
ICore::addAdditionalContext(debuggerNotRunning);
m_arguments = arguments;
if (!m_arguments.isEmpty())
connect(ProjectExplorerPlugin::instance(), &ProjectExplorerPlugin::finishedInitialization,
@@ -1225,34 +1231,37 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
debugMenu->addSeparator();
cmd = ActionManager::registerAction(&m_nextAction, Constants::NEXT);
cmd = ActionManager::registerAction(&m_startAndBreakOnMain,
Constants::START_AND_BREAK_ON_MAIN,
debuggerNotRunning);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
cmd->setAttribute(Command::CA_Hide);
cmd->setAttribute(Command::CA_UpdateText);
debugMenu->addAction(cmd);
m_nextAction.setIcon(Icons::STEP_OVER.icon());
connect(&m_nextAction, &QAction::triggered, this, [] {
if (DebuggerEngine *engine = EngineManager::currentEngine()) {
engine->handleExecNext();
} else {
DebuggerRunTool::setBreakOnMainNextTime();
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false);
}
connect(&m_startAndBreakOnMain, &QAction::triggered, this, [] {
DebuggerRunTool::setBreakOnMainNextTime();
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false);
});
cmd = ActionManager::registerAction(&m_stepAction, Constants::STEP);
cmd = ActionManager::registerAction(&m_stepOverAction, Constants::NEXT, debuggerRunning);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+O") : tr("F10")));
cmd->setAttribute(Command::CA_Hide);
debugMenu->addAction(cmd);
m_stepOverAction.setIcon(Icons::STEP_OVER.icon());
connect(&m_stepOverAction, &QAction::triggered, this, [] {
DebuggerEngine *engine = EngineManager::currentEngine();
QTC_ASSERT(engine, return);
engine->handleExecStepOver();
});
cmd = ActionManager::registerAction(&m_stepInAction, Constants::STEP, debuggerRunning);
cmd->setDefaultKeySequence(QKeySequence(useMacShortcuts ? tr("Ctrl+Shift+I") : tr("F11")));
cmd->setAttribute(Command::CA_Hide);
cmd->setAttribute(Command::CA_UpdateText);
debugMenu->addAction(cmd);
m_stepAction.setIcon(Icons::STEP_OVER.icon());
connect(&m_stepAction, &QAction::triggered, this, [] {
if (DebuggerEngine *engine = EngineManager::currentEngine()) {
engine->handleExecStep();
} else {
DebuggerRunTool::setBreakOnMainNextTime();
ProjectExplorerPlugin::runStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE, false);
}
m_stepInAction.setIcon(Icons::STEP_INTO.icon());
connect(&m_stepInAction, &QAction::triggered, this, [] {
DebuggerEngine *engine = EngineManager::currentEngine();
QTC_ASSERT(engine, return);
engine->handleExecStepIn();
});
@@ -1469,10 +1478,10 @@ void DebuggerPluginPrivate::updatePresetState()
// correspond to the current start up project.
// Step into/next: Start and break at 'main' unless a debugger is running.
QString stepToolTip = canRun ? tr("Start \"%1\" and break at function \"main\"").arg(startupRunConfigName) : whyNot;
m_stepAction.setToolTip(stepToolTip);
m_nextAction.setToolTip(stepToolTip);
m_stepAction.setEnabled(canRun);
m_nextAction.setEnabled(canRun);
m_stepInAction.setEnabled(canRun);
m_stepInAction.setToolTip(stepToolTip);
m_stepOverAction.setEnabled(canRun);
m_stepOverAction.setToolTip(stepToolTip);
m_startAction.setEnabled(canRun);
m_startAction.setIcon(startIcon(false));
m_startAction.setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
@@ -1492,8 +1501,8 @@ void DebuggerPluginPrivate::updatePresetState()
QTC_ASSERT(currentEngine, return);
// We have a current engine, and it belongs to the startup runconfig.
m_stepAction.setToolTip(QString());
m_nextAction.setToolTip(QString());
m_stepInAction.setToolTip(QString());
m_stepOverAction.setToolTip(QString());
// The 'state' bits only affect the fat debug button, not the preset start button.
m_startAction.setIcon(startIcon(false));
@@ -1522,8 +1531,8 @@ void DebuggerPluginPrivate::updatePresetState()
m_debugWithoutDeployAction.setEnabled(false);
m_visibleStartAction.setAction(&m_continueAction);
m_hiddenStopAction.setAction(&m_exitAction);
m_stepAction.setEnabled(!companionPreventsAction);
m_nextAction.setEnabled(!companionPreventsAction);
m_stepInAction.setEnabled(!companionPreventsAction);
m_stepOverAction.setEnabled(!companionPreventsAction);
m_jumpToLineAction.setEnabled(currentEngine->hasCapability(JumpToLineCapability));
m_returnFromFunctionAction.setEnabled(currentEngine->hasCapability(ReturnFromFunctionCapability));
m_detachAction.setEnabled(!isCore);
@@ -1541,8 +1550,8 @@ void DebuggerPluginPrivate::updatePresetState()
m_debugWithoutDeployAction.setEnabled(false);
m_visibleStartAction.setAction(&m_interruptAction);
m_hiddenStopAction.setAction(&m_interruptAction);
m_stepAction.setEnabled(false);
m_nextAction.setEnabled(false);
m_stepInAction.setEnabled(false);
m_stepOverAction.setEnabled(false);
m_jumpToLineAction.setEnabled(false);
m_returnFromFunctionAction.setEnabled(false);
m_detachAction.setEnabled(false);
@@ -1560,8 +1569,8 @@ void DebuggerPluginPrivate::updatePresetState()
m_debugWithoutDeployAction.setEnabled(canRun);
m_visibleStartAction.setAction(&m_startAction);
m_hiddenStopAction.setAction(&m_undisturbableAction);
m_stepAction.setEnabled(false);
m_nextAction.setEnabled(false);
m_stepInAction.setEnabled(false);
m_stepOverAction.setEnabled(false);
m_jumpToLineAction.setEnabled(false);
m_returnFromFunctionAction.setEnabled(false);
m_detachAction.setEnabled(false);
@@ -1579,8 +1588,8 @@ void DebuggerPluginPrivate::updatePresetState()
m_debugWithoutDeployAction.setEnabled(false);
m_visibleStartAction.setAction(&m_exitAction);
m_hiddenStopAction.setAction(&m_exitAction);
m_stepAction.setEnabled(false);
m_nextAction.setEnabled(false);
m_stepInAction.setEnabled(false);
m_stepOverAction.setEnabled(false);
m_jumpToLineAction.setEnabled(false);
m_returnFromFunctionAction.setEnabled(false);
m_detachAction.setEnabled(false);
@@ -1601,8 +1610,8 @@ void DebuggerPluginPrivate::updatePresetState()
m_debugWithoutDeployAction.setEnabled(false);
m_visibleStartAction.setAction(&m_undisturbableAction);
m_hiddenStopAction.setAction(&m_undisturbableAction);
m_stepAction.setEnabled(false);
m_nextAction.setEnabled(false);
m_stepInAction.setEnabled(false);
m_stepOverAction.setEnabled(false);
m_jumpToLineAction.setEnabled(false);
m_returnFromFunctionAction.setEnabled(false);
m_detachAction.setEnabled(false);
@@ -2064,13 +2073,13 @@ void DebuggerPluginPrivate::setInitialState()
m_interruptAction.setEnabled(false);
m_continueAction.setEnabled(false);
m_stepAction.setEnabled(true);
m_stepInAction.setEnabled(true);
m_stepOutAction.setEnabled(false);
m_runToLineAction.setEnabled(false);
m_runToSelectedFunctionAction.setEnabled(true);
m_returnFromFunctionAction.setEnabled(false);
m_jumpToLineAction.setEnabled(false);
m_nextAction.setEnabled(true);
m_stepOverAction.setEnabled(true);
action(AutoDerefPointers)->setEnabled(true);
action(ExpandStack)->setEnabled(false);