forked from qt-creator/qt-creator
debugger: fix shutdown by pressing "[x]" in the output pane
This commit is contained in:
@@ -186,7 +186,7 @@ private:
|
||||
|
||||
bool CommandHandler::setData(const QModelIndex &, const QVariant &value, int role)
|
||||
{
|
||||
QTC_ASSERT(m_engine, return false);
|
||||
QTC_ASSERT(m_engine, qDebug() << value << role; return false);
|
||||
m_engine->handleCommand(role, value);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -251,7 +251,7 @@ public slots:
|
||||
void startSuccessful();
|
||||
void startFailed();
|
||||
void raiseApplication();
|
||||
void quitDebugger() { exitDebugger(); }
|
||||
virtual void quitDebugger() { exitDebugger(); } // called by DebuggerRunControl
|
||||
|
||||
protected:
|
||||
void setState(DebuggerState state, bool forced = false);
|
||||
|
||||
@@ -510,7 +510,7 @@ void DebuggerRunControl::stop()
|
||||
{
|
||||
m_running = false;
|
||||
QTC_ASSERT(m_engine, return);
|
||||
m_engine->exitDebugger();
|
||||
m_engine->quitDebugger();
|
||||
}
|
||||
|
||||
void DebuggerRunControl::debuggingFinished()
|
||||
|
||||
@@ -1620,7 +1620,8 @@ QString GdbEngine::cleanupFullName(const QString &fileName)
|
||||
|
||||
void GdbEngine::shutdown()
|
||||
{
|
||||
showMessage(_("INITIATE GDBENGINE SHUTDOWN"));
|
||||
showMessage(_("INITIATE GDBENGINE SHUTDOWN IN STATE %1, PROC: %2")
|
||||
.arg(state()).arg(gdbProc()->state()));
|
||||
if (m_progress) {
|
||||
m_progress->setProgressValue(90);
|
||||
m_progress->reportCanceled();
|
||||
@@ -1726,7 +1727,19 @@ void GdbEngine::exitDebugger()
|
||||
{
|
||||
disconnectDebuggingHelperActions();
|
||||
shutdown();
|
||||
//gdbProc()->kill();
|
||||
}
|
||||
|
||||
void GdbEngine::quitDebugger()
|
||||
{
|
||||
// FIXME: The problem here is that the "kill" send in the shutdown()
|
||||
// procedure might not receive a response anymore. So we need a way
|
||||
// to force it down. On the other hand, there could be an answer,
|
||||
// and regular the inferior shutdown procedure could take a while.
|
||||
// And the RunControl::stop() is called synchroneously.
|
||||
disconnectDebuggingHelperActions();
|
||||
shutdown();
|
||||
initializeVariables();
|
||||
setState(DebuggerNotReady);
|
||||
}
|
||||
|
||||
int GdbEngine::currentFrame() const
|
||||
|
||||
@@ -108,6 +108,7 @@ private: ////////// General Interface //////////
|
||||
virtual void startDebugger();
|
||||
virtual unsigned debuggerCapabilities() const;
|
||||
virtual void exitDebugger();
|
||||
virtual void quitDebugger();
|
||||
virtual void detachDebugger();
|
||||
virtual void shutdown();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user