Commit 8afd8b86 authored by hjk's avatar hjk
Browse files

debugger: deactivate thread window operations during stepping

parent ed30a3f7
......@@ -225,6 +225,7 @@ public slots:
void scheduleResetLocation()
{
m_stackHandler.scheduleResetLocation();
m_threadsHandler.scheduleResetLocation();
m_disassemblerAgent.scheduleResetLocation();
m_locationTimer.setSingleShot(true);
m_locationTimer.start(80);
......@@ -235,6 +236,7 @@ public slots:
m_locationTimer.stop();
m_locationMark.reset();
m_stackHandler.resetLocation();
m_threadsHandler.resetLocation();
m_disassemblerAgent.resetLocation();
}
......
......@@ -104,6 +104,8 @@ ThreadsHandler::ThreadsHandler()
m_positionIcon(QLatin1String(":/debugger/images/location_16.png")),
m_emptyIcon(QLatin1String(":/debugger/images/debugger_empty_14.png"))
{
m_resetLocationScheduled = false;
m_contentsValid = false;
}
int ThreadsHandler::rowCount(const QModelIndex &parent) const
......@@ -194,6 +196,11 @@ QVariant ThreadsHandler::headerData
return QVariant();
}
Qt::ItemFlags ThreadsHandler::flags(const QModelIndex &index) const
{
return m_contentsValid ? QAbstractTableModel::flags(index) : Qt::ItemFlags(0);
}
int ThreadsHandler::currentThreadId() const
{
if (m_currentIndex < 0 || m_currentIndex >= m_threads.size())
......@@ -241,7 +248,9 @@ void ThreadsHandler::setThreads(const Threads &threads)
m_threads = threads;
if (m_currentIndex >= m_threads.size())
m_currentIndex = -1;
layoutChanged();
m_resetLocationScheduled = false;
m_contentsValid = true;
reset();
}
Threads ThreadsHandler::threads() const
......@@ -253,7 +262,7 @@ void ThreadsHandler::removeAll()
{
m_threads.clear();
m_currentIndex = 0;
layoutChanged();
reset();
}
void ThreadsHandler::notifyRunning()
......@@ -303,5 +312,19 @@ Threads ThreadsHandler::parseGdbmiThreads(const GdbMi &data, int *currentThread)
return threads;
}
void ThreadsHandler::scheduleResetLocation()
{
m_resetLocationScheduled = true;
m_contentsValid = false;
}
void ThreadsHandler::resetLocation()
{
if (m_resetLocationScheduled) {
m_resetLocationScheduled = false;
reset();
}
}
} // namespace Internal
} // namespace Debugger
......@@ -70,17 +70,24 @@ public:
static Threads parseGdbmiThreads(const GdbMi &data, int *currentThread = 0);
void resetLocation();
void scheduleResetLocation();
private:
int rowCount(const QModelIndex &parent = QModelIndex()) const;
int columnCount(const QModelIndex &parent = QModelIndex()) const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
QVariant headerData(int section, Qt::Orientation orientation,
int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex &index) const;
Threads m_threads;
int m_currentIndex;
const QIcon m_positionIcon;
const QIcon m_emptyIcon;
bool m_resetLocationScheduled;
bool m_contentsValid;
};
} // namespace Internal
......
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