diff --git a/src/plugins/debugger/debuggerengine.cpp b/src/plugins/debugger/debuggerengine.cpp index 4d2f088ae2644debb4a4055fe5f0a1de7f9f4ddc..0ee1117ba9996cd95b8c5fca2f478a506279cd4d 100644 --- a/src/plugins/debugger/debuggerengine.cpp +++ b/src/plugins/debugger/debuggerengine.cpp @@ -713,6 +713,7 @@ static bool isAllowedTransition(DebuggerState from, DebuggerState to) case EngineRunRequested: return to == EngineRunFailed + || to == InferiorRunRequested || to == InferiorRunOk || to == InferiorStopOk || to == InferiorUnrunnable; @@ -922,6 +923,16 @@ void DebuggerEngine::notifyEngineRemoteSetupFailed(const QString &message) qDebug() << this << "remoteSetupState" << d->remoteSetupState()); } +void DebuggerEngine::notifyEngineRunOkAndInferiorRunRequested() +{ + showMessage(_("NOTE: ENGINE RUN OK AND INFERIOR RUN REQUESTED")); + d->m_progress.setProgressValue(1000); + d->m_progress.reportFinished(); + QTC_ASSERT(state() == EngineRunRequested, qDebug() << this << state()); + showStatusMessage(tr("Running.")); + setState(InferiorRunRequested); +} + void DebuggerEngine::notifyEngineRunAndInferiorRunOk() { showMessage(_("NOTE: ENGINE RUN AND INFERIOR RUN OK")); @@ -952,10 +963,15 @@ void DebuggerEngine::notifyInferiorRunRequested() void DebuggerEngine::notifyInferiorRunOk() { + if (state() == InferiorRunOk) { + showMessage(_("NOTE: INFERIOR RUN OK - REPEATED.")); + return; + } showMessage(_("NOTE: INFERIOR RUN OK")); showStatusMessage(tr("Running.")); - // Transition from StopRequested can happen sin remotegdbadapter. + // Transition from StopRequested can happen in remotegdbadapter. QTC_ASSERT(state() == InferiorRunRequested + || state() == InferiorStopOk || state() == InferiorStopRequested, qDebug() << this << state()); setState(InferiorRunOk); } diff --git a/src/plugins/debugger/debuggerengine.h b/src/plugins/debugger/debuggerengine.h index 580a3e4db7e810e4365b94c9d873ca0c1b2f2687..e4a260dae5d22df40511176d50db7b56685baba7 100644 --- a/src/plugins/debugger/debuggerengine.h +++ b/src/plugins/debugger/debuggerengine.h @@ -305,6 +305,7 @@ protected: virtual void notifyInferiorSetupOk(); virtual void notifyInferiorSetupFailed(); + virtual void notifyEngineRunOkAndInferiorRunRequested(); virtual void notifyEngineRunAndInferiorRunOk(); virtual void notifyEngineRunAndInferiorStopOk(); virtual void notifyInferiorUnrunnable(); // Called by CoreAdapter. diff --git a/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp b/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp index 2b76292dfba6037fb5796130f416714008e59a62..3decbaa8109a687266fb1a46c89f0716adaf4822 100644 --- a/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp +++ b/src/plugins/debugger/gdb/abstractplaingdbadapter.cpp @@ -88,7 +88,8 @@ void GdbAbstractPlainEngine::handleExecRun(const GdbResponse &response) { QTC_ASSERT(state() == EngineRunRequested, qDebug() << state()); if (response.resultClass == GdbResultRunning) { - notifyEngineRunAndInferiorRunOk(); + //notifyEngineRunOkAndInferiorRunRequested(); + notifyEngineRunAndInferiorRunOk(); // For gdb < 7.0 //showStatusMessage(tr("Running...")); showMessage(_("INFERIOR STARTED")); showMessage(msgInferiorSetupOk(), StatusBar); diff --git a/src/plugins/debugger/gdb/classicgdbengine.cpp b/src/plugins/debugger/gdb/classicgdbengine.cpp index bdce5a52e0dfc1269a4ad7f680624830dc31f703..b775b6e815bf3dbc46da082f7021a8757059177f 100644 --- a/src/plugins/debugger/gdb/classicgdbengine.cpp +++ b/src/plugins/debugger/gdb/classicgdbengine.cpp @@ -723,11 +723,6 @@ void GdbEngine::updateLocalsClassic() m_pendingBreakpointRequests = 0; m_processedNames.clear(); - if (0 && debugPending) - qDebug() << "\nRESET PENDING"; - //m_toolTipCache.clear(); - clearToolTip(); - QByteArray level = QByteArray::number(currentFrame()); // '2' is 'list with type and value' QByteArray cmd = "-stack-list-arguments 2 " + level + ' ' + level; diff --git a/src/plugins/debugger/gdb/gdbengine.cpp b/src/plugins/debugger/gdb/gdbengine.cpp index cfea2e6e9b21801ad6de1287e471d6e4a7320226..74d1383c4c4d508c0e78ad4c24dbf9eda534b4f0 100644 --- a/src/plugins/debugger/gdb/gdbengine.cpp +++ b/src/plugins/debugger/gdb/gdbengine.cpp @@ -469,7 +469,12 @@ void GdbEngine::handleResponse(const QByteArray &buff) m_pendingLogStreamOutput.clear(); m_pendingConsoleStreamOutput.clear(); } else if (asyncClass == "running") { - // Archer has 'thread-id="all"' here + if (state() == InferiorRunOk) { + // We get multiple *running after thread creation. + showMessage(_("NOTE: INFERIOR STILL RUNNING.")); + } else { + notifyInferiorRunOk(); + } } else if (asyncClass == "library-loaded") { // Archer has 'id="/usr/lib/libdrm.so.2", // target-name="/usr/lib/libdrm.so.2", @@ -1301,8 +1306,9 @@ void GdbEngine::handleQuerySources(const GdbResponse &response) void GdbEngine::handleExecuteJumpToLine(const GdbResponse &response) { if (response.resultClass == GdbResultRunning) { - doNotifyInferiorRunOk(); - // All is fine. Waiting for the temporary breakpoint to be hit. + // All is fine. Waiting for a *running + // and the temporary breakpoint to be hit. + notifyInferiorRunOk(); // Only needed for gdb < 7.0. } else if (response.resultClass == GdbResultDone) { // This happens on old gdb. Trigger the effect of a '*stopped'. showStatusMessage(tr("Jumped. Stopped")); @@ -1314,8 +1320,8 @@ void GdbEngine::handleExecuteJumpToLine(const GdbResponse &response) void GdbEngine::handleExecuteRunToLine(const GdbResponse &response) { if (response.resultClass == GdbResultRunning) { - doNotifyInferiorRunOk(); - // All is fine. Waiting for the temporary breakpoint to be hit. + // All is fine. Waiting for a *running + // and the temporary breakpoint to be hit. } else if (response.resultClass == GdbResultDone) { // This happens on old gdb (Mac). gdb is not stopped yet, // but merely accepted the continue. @@ -1480,7 +1486,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data) // be handled in the result handler. // -- or -- // *stopped arriving earlier than ^done response to an -exec-step - doNotifyInferiorRunOk(); notifyInferiorSpontaneousStop(); } else if (state() == InferiorStopOk) { // That's expected. @@ -1875,7 +1880,8 @@ void GdbEngine::handleExecuteContinue(const GdbResponse &response) { QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state()); if (response.resultClass == GdbResultRunning) { - doNotifyInferiorRunOk(); + // All is fine. Waiting for a *running. + notifyInferiorRunOk(); // Only needed for gdb < 7.0. return; } QByteArray msg = response.data.findChild("msg").data(); @@ -2136,12 +2142,6 @@ void GdbEngine::continueInferiorInternal() postCommand("-exec-continue", RunRequest, CB(handleExecuteContinue)); } -void GdbEngine::doNotifyInferiorRunOk() -{ - clearToolTip(); - notifyInferiorRunOk(); -} - void GdbEngine::autoContinueInferior() { resetLocation(); @@ -2181,7 +2181,8 @@ void GdbEngine::handleExecuteStep(const GdbResponse &response) } QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state()); if (response.resultClass == GdbResultRunning) { - doNotifyInferiorRunOk(); + // All is fine. Waiting for a *running. + notifyInferiorRunOk(); // Only needed for gdb < 7.0. return; } QByteArray msg = response.data.findChild("msg").data(); @@ -2258,7 +2259,8 @@ void GdbEngine::handleExecuteNext(const GdbResponse &response) } QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state()); if (response.resultClass == GdbResultRunning) { - doNotifyInferiorRunOk(); + // All is fine. Waiting for a *running. + notifyInferiorRunOk(); // Only needed for gdb < 7.0. return; } QTC_ASSERT(state() == InferiorStopOk, qDebug() << state()); @@ -3871,9 +3873,10 @@ QString GdbEngine::tooltipExpression() const return m_toolTipContext.isNull() ? QString() : m_toolTipContext->expression; } -void GdbEngine::clearToolTip() +void GdbEngine::resetLocation() { m_toolTipContext.reset(); + DebuggerEngine::resetLocation(); } bool GdbEngine::setToolTipExpression(const QPoint &mousePos, diff --git a/src/plugins/debugger/gdb/gdbengine.h b/src/plugins/debugger/gdb/gdbengine.h index cd2e513653f6e0101d3f03e90818884f528b639d..0a4599ec360ae203ba64ce93db49699c7ad8d296 100644 --- a/src/plugins/debugger/gdb/gdbengine.h +++ b/src/plugins/debugger/gdb/gdbengine.h @@ -414,7 +414,6 @@ private: ////////// Inferior Management ////////// protected: void continueInferiorInternal(); - void doNotifyInferiorRunOk(); void autoContinueInferior(); void continueInferior(); void interruptInferior(); @@ -441,6 +440,7 @@ private: ////////// View & Data Stuff ////////// void selectThread(int index); void activateFrame(int index); + void resetLocation(); // // Breakpoint specific stuff @@ -659,7 +659,6 @@ protected: static QByteArray tooltipIName(const QString &exp); QString tooltipExpression() const; - void clearToolTip(); QScopedPointer<GdbToolTipContext> m_toolTipContext;