Commit c1e0a788 authored by hjk's avatar hjk

debugger: don't dead-lock when switching sessions while debugging

parent 18061710
......@@ -1053,6 +1053,15 @@ void DebuggerManager::sessionLoaded()
loadSessionData();
}
void DebuggerManager::sessionUnloaded()
{
cleanupViews();
if (m_engine)
m_engine->shutdown();
setStatus(DebuggerProcessNotReady);
setBusyCursor(false);
}
void DebuggerManager::aboutToSaveSession()
{
saveSessionData();
......
......@@ -233,6 +233,7 @@ public slots:
void updateWatchModel();
void sessionLoaded();
void sessionUnloaded();
void aboutToSaveSession();
void assignValueInDebugger();
......
......@@ -752,6 +752,8 @@ bool DebuggerPlugin::initialize(const QStringList &arguments, QString *errorMess
m_manager, SLOT(sessionLoaded()));
connect(sessionManager(), SIGNAL(aboutToSaveSession()),
m_manager, SLOT(aboutToSaveSession()));
connect(sessionManager(), SIGNAL(sessionUnloaded()),
m_manager, SLOT(sessionUnloaded()));
// EditorManager
QObject *editorManager = core->editorManager();
......
......@@ -398,6 +398,10 @@ void GdbEngine::handleResponse(const QByteArray &buff)
// Archer has "{id="28902"}"
} else if (asyncClass == "thread-created") {
//"{id="1",group-id="28902"}"
} else if (asyncClass == "thread-group-exited") {
// Archer has "{id="28902"}"
} else if (asyncClass == "thread-exited") {
//"{id="1",group-id="28902"}"
#ifdef Q_OS_MAC
} else if (asyncClass == "shlibs-updated") {
// MAC announces updated libs
......
......@@ -54,7 +54,6 @@ class RegisterHandler : public QAbstractTableModel
public:
RegisterHandler(QObject *parent = 0);
void sessionClosed();
QAbstractItemModel *model() { return this; }
bool isEmpty() const; // nothing known so far?
......
......@@ -996,16 +996,16 @@ void SessionManager::removeProjects(QList<Project *> remove)
void SessionManager::setValue(const QString &name, const QVariant &value)
{
m_file->m_values.insert(name, value);
if (m_file)
m_file->m_values.insert(name, value);
}
QVariant SessionManager::value(const QString &name)
{
QMap<QString, QVariant>::const_iterator it = m_file->m_values.find(name);
if (it != m_file->m_values.constEnd())
return *it;
else
if (!m_file)
return QVariant();
QMap<QString, QVariant>::const_iterator it = m_file->m_values.find(name);
return (it == m_file->m_values.constEnd()) ? QVariant() : *it;
}
QString SessionManager::activeSession() const
......
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