forked from qt-creator/qt-creator
debugger: cleanup gdb command queue when inferior setup failed
This commit is contained in:
@@ -269,38 +269,41 @@ public:
|
|||||||
virtual void quitDebugger(); // called by DebuggerRunControl
|
virtual void quitDebugger(); // called by DebuggerRunControl
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void notifyEngineSetupOk();
|
// The base notify*() function implementation should be sufficient
|
||||||
void notifyEngineSetupFailed();
|
// in most cases, but engines are free to override them to do some
|
||||||
void notifyEngineRunFailed();
|
// engine specific cleanup like stopping timers etc.
|
||||||
|
virtual void notifyEngineSetupOk();
|
||||||
|
virtual void notifyEngineSetupFailed();
|
||||||
|
virtual void notifyEngineRunFailed();
|
||||||
|
|
||||||
void notifyInferiorSetupOk();
|
virtual void notifyInferiorSetupOk();
|
||||||
void notifyInferiorSetupFailed();
|
virtual void notifyInferiorSetupFailed();
|
||||||
|
|
||||||
void notifyEngineRunAndInferiorRunOk();
|
virtual void notifyEngineRunAndInferiorRunOk();
|
||||||
void notifyEngineRunAndInferiorStopOk();
|
virtual void notifyEngineRunAndInferiorStopOk();
|
||||||
void notifyInferiorUnrunnable(); // Called by CoreAdapter.
|
virtual void notifyInferiorUnrunnable(); // Called by CoreAdapter.
|
||||||
|
|
||||||
// Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead.
|
// Use notifyInferiorRunRequested() plus notifyInferiorRunOk() instead.
|
||||||
//void notifyInferiorSpontaneousRun();
|
//virtual void notifyInferiorSpontaneousRun();
|
||||||
|
|
||||||
void notifyInferiorRunRequested();
|
virtual void notifyInferiorRunRequested();
|
||||||
void notifyInferiorRunOk();
|
virtual void notifyInferiorRunOk();
|
||||||
void notifyInferiorRunFailed();
|
virtual void notifyInferiorRunFailed();
|
||||||
|
|
||||||
void notifyInferiorStopOk();
|
virtual void notifyInferiorStopOk();
|
||||||
void notifyInferiorSpontaneousStop();
|
virtual void notifyInferiorSpontaneousStop();
|
||||||
void notifyInferiorStopFailed();
|
virtual void notifyInferiorStopFailed();
|
||||||
void notifyInferiorExited();
|
virtual void notifyInferiorExited();
|
||||||
|
|
||||||
void notifyInferiorShutdownOk();
|
virtual void notifyInferiorShutdownOk();
|
||||||
void notifyInferiorShutdownFailed();
|
virtual void notifyInferiorShutdownFailed();
|
||||||
|
|
||||||
void notifyEngineSpontaneousShutdown();
|
virtual void notifyEngineSpontaneousShutdown();
|
||||||
void notifyEngineShutdownOk();
|
virtual void notifyEngineShutdownOk();
|
||||||
void notifyEngineShutdownFailed();
|
virtual void notifyEngineShutdownFailed();
|
||||||
|
|
||||||
void notifyInferiorIll();
|
virtual void notifyInferiorIll();
|
||||||
void notifyEngineIll();
|
virtual void notifyEngineIll();
|
||||||
|
|
||||||
virtual void setupEngine() = 0;
|
virtual void setupEngine() = 0;
|
||||||
virtual void setupInferior() = 0;
|
virtual void setupInferior() = 0;
|
||||||
|
|||||||
@@ -4190,6 +4190,14 @@ void GdbEngine::setupInferior()
|
|||||||
m_gdbAdapter->setupInferior();
|
m_gdbAdapter->setupInferior();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GdbEngine::notifyInferiorSetupFailed()
|
||||||
|
{
|
||||||
|
// FIXME: that's not enough to stop gdb from getting confused
|
||||||
|
// by a timeout of the adapter.
|
||||||
|
//resetCommandQueue();
|
||||||
|
DebuggerEngine::notifyInferiorSetupFailed();
|
||||||
|
}
|
||||||
|
|
||||||
void GdbEngine::handleInferiorPrepared()
|
void GdbEngine::handleInferiorPrepared()
|
||||||
{
|
{
|
||||||
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
|
||||||
@@ -4289,6 +4297,19 @@ void GdbEngine::handleCreateFullBacktrace(const GdbResponse &response)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GdbEngine::resetCommandQueue()
|
||||||
|
{
|
||||||
|
m_commandTimer->stop();
|
||||||
|
if (!m_cookieForToken.isEmpty()) {
|
||||||
|
QString msg;
|
||||||
|
QTextStream ts(&msg);
|
||||||
|
ts << "RESETING COMMAND QUEUE. LEFT OVER TOKENS: ";
|
||||||
|
foreach (const GdbCommand &cookie, m_cookieForToken)
|
||||||
|
ts << "CMD:" << cookie.command << cookie.callbackName;
|
||||||
|
m_cookieForToken.clear();
|
||||||
|
showMessage(msg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Factory
|
// Factory
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ private: ////////// General Interface //////////
|
|||||||
virtual void detachDebugger();
|
virtual void detachDebugger();
|
||||||
virtual void shutdownEngine();
|
virtual void shutdownEngine();
|
||||||
virtual void shutdownInferior();
|
virtual void shutdownInferior();
|
||||||
|
virtual void notifyInferiorSetupFailed();
|
||||||
|
|
||||||
virtual void executeDebuggerCommand(const QString &command);
|
virtual void executeDebuggerCommand(const QString &command);
|
||||||
virtual QString qtNamespace() const { return m_dumperHelper.qtNamespace(); }
|
virtual QString qtNamespace() const { return m_dumperHelper.qtNamespace(); }
|
||||||
@@ -287,6 +288,7 @@ private: ////////// Gdb Output, State & Capability Handling //////////
|
|||||||
void handleStop1(const GdbResponse &response);
|
void handleStop1(const GdbResponse &response);
|
||||||
void handleStop1(const GdbMi &data);
|
void handleStop1(const GdbMi &data);
|
||||||
StackFrame parseStackFrame(const GdbMi &mi, int level);
|
StackFrame parseStackFrame(const GdbMi &mi, int level);
|
||||||
|
void resetCommandQueue();
|
||||||
|
|
||||||
bool isSynchroneous() const { return hasPython(); }
|
bool isSynchroneous() const { return hasPython(); }
|
||||||
virtual bool hasPython() const;
|
virtual bool hasPython() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user