Commit 28b549cf authored by Igor Kushnir's avatar Igor Kushnir Committed by Milian Wolff
Browse files

Implement virtual DebugSession::killDebuggerNow()

https://commits.kde.org/kdevelop/37ff587ebe2a2c355d71cb583fb5f058c5301ff3
introduced a pure virtual IDebugSession::killDebuggerNow() member
function. DebugSession must override it to become non-abstract and fix
the following compilation error (GCC):
  invalid new-expression of abstract class type ‘Python::DebugSession’

DebugSession::killDebuggerNow() kills the debugger process
unconditionally to mimic the behavior of ~DebugSession().

As far as I can tell, DebugSession::killDebuggerNow() will never be
called, because DebugSession::stopDebugger() switches to EndedState
synchronously and is destroyed before ~DebugController() invokes
&IDebugSession::killDebuggerNow.
parent 2f189cfd
......@@ -494,10 +494,22 @@ void DebugSession::stopDebugger()
if ( ! m_debuggerProcess->waitForFinished(200) ) {
m_debuggerProcess->kill();
}
qCDebug(KDEV_PYTHON_DEBUGGER) << "stopped debugger";
finalizeState();
}
void DebugSession::killDebuggerNow()
{
qCDebug(KDEV_PYTHON_DEBUGGER) << "killing debugger now";
m_debuggerProcess->kill();
finalizeState();
}
void DebugSession::finalizeState()
{
m_commandQueue.clear();
m_nextNotifyMethod = nullptr;
m_nextNotifyObject.clear();
qCDebug(KDEV_PYTHON_DEBUGGER) << "killed debugger";
setState(IDebugSession::EndedState);
}
......
......@@ -134,6 +134,11 @@ public:
**/
void stopDebugger() override;
/**
* @brief Kill the debugger process synchronously
**/
void killDebuggerNow() override;
/**
* @brief Gives the debugger state.
* The two main states are "ActiveState" and "PausedState"; the former is given
......@@ -251,6 +256,11 @@ private:
**/
void clearOutputBuffer();
/**
* @brief Clean up and switch to EndedState after stopping/killing the debugger
**/
void finalizeState();
/// stores whether the data currently received comes from the debugger
/// or the debuggee.
int m_inDebuggerData;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment