forked from qt-creator/qt-creator
Debugger: Fix switching threads using the threadsview
Amends 9f9c7230
.
Change-Id: I58193f2d159bb6b839762b0cf02ec8fc4a9df48a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -397,11 +397,7 @@ public:
|
||||
void selectThread(int index)
|
||||
{
|
||||
const Thread thread = m_engine->threadsHandler()->rootItem()->childAt(index);
|
||||
QTC_ASSERT(thread, return);
|
||||
// For immediate visual feedback.
|
||||
m_engine->threadsHandler()->setCurrentThread(thread);
|
||||
// Initiate the actual switching in the debugger backend.
|
||||
m_engine->selectThread(thread);
|
||||
m_engine->doSelectThread(thread);
|
||||
}
|
||||
|
||||
void handleOperateByInstructionTriggered(bool on)
|
||||
@@ -2082,6 +2078,16 @@ void DebuggerEngine::assignValueInDebugger(WatchItem *,
|
||||
{
|
||||
}
|
||||
|
||||
void DebuggerEngine::doSelectThread(const Thread &thread)
|
||||
{
|
||||
QTC_ASSERT(thread, return);
|
||||
// For immediate visual feedback.
|
||||
d->m_threadsHandler.setCurrentThread(thread);
|
||||
d->m_threadBox->setCurrentIndex(d->m_threadsHandler.currentThreadIndex());
|
||||
// Initiate the actual switching in the debugger backend.
|
||||
selectThread(thread);
|
||||
}
|
||||
|
||||
void DebuggerEngine::handleRecordReverse(bool record)
|
||||
{
|
||||
executeRecordReverse(record);
|
||||
|
@@ -317,6 +317,7 @@ public:
|
||||
virtual void assignValueInDebugger(WatchItem *item,
|
||||
const QString &expr, const QVariant &value);
|
||||
virtual void selectThread(const Internal::Thread &thread) = 0;
|
||||
void doSelectThread(const Internal::Thread &thread);
|
||||
|
||||
virtual void executeRecordReverse(bool) {}
|
||||
virtual void executeReverse(bool) {}
|
||||
|
@@ -240,7 +240,8 @@ bool ThreadsHandler::setData(const QModelIndex &idx, const QVariant &data, int r
|
||||
{
|
||||
if (role == BaseTreeView::ItemActivatedRole) {
|
||||
const Thread thread = itemForIndexAtLevel<1>(idx);
|
||||
m_engine->selectThread(thread);
|
||||
if (thread != m_currentThread)
|
||||
m_engine->doSelectThread(thread);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user