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

@@ -224,7 +224,7 @@ void CdbEngine::init()
m_stopMode = NoStopRequested;
m_nextCommandToken = 0;
m_currentBuiltinResponseToken = -1;
m_operateByInstruction = true; // Default CDB setting.
m_lastOperateByInstruction = true; // Default CDB setting.
m_hasDebuggee = false;
m_sourceStepInto = false;
m_watchPointX = m_watchPointY = 0;
@@ -266,14 +266,13 @@ void CdbEngine::init()
CdbEngine::~CdbEngine() = default;
void CdbEngine::operateByInstructionTriggered(bool operateByInstruction)
void CdbEngine::adjustOperateByInstruction(bool operateByInstruction)
{
DebuggerEngine::operateByInstructionTriggered(operateByInstruction);
if (m_operateByInstruction == operateByInstruction)
if (m_lastOperateByInstruction == operateByInstruction)
return;
m_operateByInstruction = operateByInstruction;
runCommand({QLatin1String(m_operateByInstruction ? "l-t" : "l+t"), NoFlags});
runCommand({QLatin1String(m_operateByInstruction ? "l-s" : "l+s"), NoFlags});
m_lastOperateByInstruction = operateByInstruction;
runCommand({QLatin1String(m_lastOperateByInstruction ? "l-t" : "l+t"), NoFlags});
runCommand({QLatin1String(m_lastOperateByInstruction ? "l-s" : "l+s"), NoFlags});
}
bool CdbEngine::canHandleToolTip(const DebuggerToolTipContext &context) const
@@ -521,7 +520,7 @@ void CdbEngine::handleInitialSessionIdle()
const DebuggerRunParameters &rp = runParameters();
if (!rp.commandsAfterConnect.isEmpty())
runCommand({rp.commandsAfterConnect, NoFlags});
operateByInstructionTriggered(operatesByInstruction());
//operateByInstructionTriggered(operatesByInstruction());
// QmlCppEngine expects the QML engine to be connected before any breakpoints are hit
// (attemptBreakpointSynchronization() will be directly called then)
if (rp.breakOnMain) {
@@ -758,10 +757,11 @@ bool CdbEngine::hasCapability(unsigned cap) const
|AdditionalQmlStackCapability);
}
void CdbEngine::executeStep()
void CdbEngine::executeStepIn(bool byInstruction)
{
if (!m_operateByInstruction)
if (!m_lastOperateByInstruction)
m_sourceStepInto = true; // See explanation at handleStackTrace().
adjustOperateByInstruction(byInstruction);
runCommand({"t", NoFlags}); // Step into-> t (trace)
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunRequested")
notifyInferiorRunRequested();
@@ -774,23 +774,14 @@ void CdbEngine::executeStepOut()
notifyInferiorRunRequested();
}
void CdbEngine::executeNext()
void CdbEngine::executeStepOver(bool byInstruction)
{
adjustOperateByInstruction(byInstruction);
runCommand({"p", NoFlags}); // Step over -> p
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunRequested")
notifyInferiorRunRequested();
}
void CdbEngine::executeStepI()
{
executeStep();
}
void CdbEngine::executeNextI()
{
executeNext();
}
void CdbEngine::continueInferior()
{
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunRequested")
@@ -1756,8 +1747,9 @@ unsigned CdbEngine::examineStopReason(const GdbMi &stopReason,
*message = bp->msgWatchpointByExpressionTriggered(bp->expression(), tid);
else
*message = bp->msgBreakpointTriggered(tid);
rc |= StopReportStatusMessage|StopNotifyStop;
rc |= StopReportStatusMessage;
}
rc |= StopNotifyStop;
return rc;
}
if (reason == "exception") {
@@ -1848,7 +1840,7 @@ void CdbEngine::processStop(const GdbMi &stopReason, bool conditionalBreakPointT
if (stack.isValid()) {
switch (parseStackTrace(stack, sourceStepInto)) {
case ParseStackStepInto: // Hit on a frame while step into, see parseStackTrace().
executeStep();
executeStepIn(operatesByInstruction());
return;
case ParseStackStepOut: // Hit on a frame with no source while step into.
executeStepOut();